Eli Mesika has submitted this change and it was merged. Change subject: core: QueryData2 generates slow SQL for... ......................................................................
core: QueryData2 generates slow SQL for... QueryData2 generates slow SQL for AuditLog with no parameters This patch fixes two issues When the inner query condition of getting the events is empty it omits the inner query. i.e. Instead of SELECT * FROM (SELECT * FROM audit_log WHERE ( audit_log_id > 0 and audit_log_id IN (SELECT audit_log.audit_log_id FROM audit_log ) and not deleted) ORDER BY audit_log_id DESC ,audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 100 Perform: SELECT * FROM (SELECT * FROM audit_log WHERE ( audit_log_id > 0 and not deleted) ORDER BY audit_log_id DESC ,audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 100; In addition, this patch fixes the redundancy in the SORT , so final query is : SELECT * FROM (SELECT * FROM audit_log WHERE ( audit_log_id > 0 and not deleted) ORDER BY audit_log_id DESC) as T1 OFFSET (1 -1) LIMIT 100; Change-Id: Id148adcc734c5742548c74ea754fb70252155e34 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=960831 Signed-off-by: Eli Mesika <emes...@redhat.com> --- M backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/SyntaxChecker.java 1 file changed, 22 insertions(+), 13 deletions(-) Approvals: Eli Mesika: Verified; Looks good to me, approved -- To view, visit http://gerrit.ovirt.org/17527 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id148adcc734c5742548c74ea754fb70252155e34 Gerrit-PatchSet: 4 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Liran Zelkha <liran.zel...@gmail.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches