From: Simon Brandhof Date: Thu, 22 Mar 2018 09:59:09 +0000 (+0100) Subject: SONAR-10505 CE processes analysis report slowly when millions of issues X-Git-Tag: 6.7.3~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=961b16e42197ebe6de35eddb269024179ba39946;p=sonarqube.git SONAR-10505 CE processes analysis report slowly when millions of issues --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIteratorForSingleChunk.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIteratorForSingleChunk.java index 6a72a75c264..57a705cfc27 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIteratorForSingleChunk.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIteratorForSingleChunk.java @@ -86,7 +86,7 @@ class IssueIteratorForSingleChunk implements IssueIterator { "inner join rules r on r.id = i.rule_id " + "inner join projects c on c.uuid = i.component_uuid "; - private static final String PROJECT_FILTER = " and c.project_uuid = ?"; + private static final String PROJECT_FILTER = " and c.project_uuid = ? and i.project_uuid = ? "; private static final String ISSUE_KEY_FILTER_PREFIX = " and i.kee in ("; private static final String ISSUE_KEY_FILTER_SUFFIX = ")"; @@ -157,6 +157,8 @@ class IssueIteratorForSingleChunk implements IssueIterator { if (projectUuid != null) { stmt.setString(index, projectUuid); index++; + stmt.setString(index, projectUuid); + index++; } if (issueKeys != null) { for (String key : issueKeys) {