Hello Liran Zelkha,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/22228

to review the following change.

Change subject: engine: Fix slow API query for list of templates in a Datacenter
......................................................................

engine: Fix slow API query for list of templates in a Datacenter

This patch improves the performance of SearcQuery for templates by Datacenter.
It improves performance by about a factor of 5.

Change-Id: I13460ae1aa3d7cb2816ed53b5ca7da64f15b8845
Bug-Url: https://bugzilla.redhat.com/1029106
Signed-off-by: lzel...@redhat.com <lzel...@redhat.com>
---
M 
backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/SyntaxChecker.java
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/28/22228/1

diff --git 
a/backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/SyntaxChecker.java
 
b/backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/SyntaxChecker.java
index 141dcd1..2738287 100644
--- 
a/backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/SyntaxChecker.java
+++ 
b/backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/SyntaxChecker.java
@@ -923,6 +923,13 @@
                                     tableNameWithOutTags, primeryKey,
                                     syntax.getSearchFrom(), innerQuery);
                 }
+            }
+            if (primeryKey.equals("vmt_guid") && wherePhrase.length() > 0
+                    && wherePhrase.toString().contains("storage_pool_name") && 
whereBuilder.size() == 1) {
+                inQuery = StringFormat
+                        .format("(SELECT * FROM %1$s %2$s",
+                                tableNameWithOutTags, 
wherePhrase.toString().replace(tableName, tableNameWithOutTags));
+
             } else {
                 inQuery = StringFormat.format(
                         "SELECT * FROM %1$s WHERE ( %2$s IN (%3$s)",


-- 
To view, visit http://gerrit.ovirt.org/22228
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I13460ae1aa3d7cb2816ed53b5ca7da64f15b8845
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Liran Zelkha <lzel...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to