Change in ovirt-engine[master]: core: QueryData2 generates slow SQL for...

emesika at redhat.com emesika at redhat.com
Thu Aug 1 11:13:31 UTC 2013


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 <emesika at 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 <emesika at redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Liran Zelkha <liran.zelkha at gmail.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list