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 <[email protected]>
---
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/18392
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id148adcc734c5742548c74ea754fb70252155e34
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: [email protected]
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to