ustcweizhou commented on issue #3306: server: reduce execution time while 
listing project if projects have many resource tags
URL: https://github.com/apache/cloudstack/pull/3306#issuecomment-489351860
 
 
   @svenvogel we have similar issue while listing accounts. for project, it can 
be improved by
   ```
   diff --git a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java 
b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
   index 91e0466..2b15113 100644
   --- a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
   +++ b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
   @@ -1298,7 +1298,7 @@ public class QueryManagerImpl extends 
MutualExclusiveIdsManagerBase implements Q
            Long accountId = null;
            String path = null;
   
   -        Filter searchFilter = new Filter(ProjectJoinVO.class, "id", false, 
startIndex, pageSize);
   +        Filter searchFilter = new Filter(ProjectJoinVO.class, null, false, 
startIndex, pageSize);
            SearchBuilder<ProjectJoinVO> sb = 
_projectJoinDao.createSearchBuilder();
            sb.select(null, Func.DISTINCT, sb.entity().getId()); // select 
distinct
            // ids
   ```
   
   Do not order project_view will reduce execution time of db query.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to