Submit: Do not request fields from index when computing topic size

To compute the size of a topic we query for open changes with a matching
topic. Since we are only interested in the number of matches we don't
need to request any fields.

Change-Id: I0f044bc2c30416e42b6c58e0bc1ce5b698f79cce
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2019-04-18 10:00:41 +02:00
parent b53ac9d921
commit 8f87816b72

View File

@@ -331,7 +331,7 @@ public class Submit
String topic = change.getTopic();
int topicSize = 0;
if (!Strings.isNullOrEmpty(topic)) {
topicSize = queryProvider.get().byTopicOpen(topic).size();
topicSize = queryProvider.get().noFields().byTopicOpen(topic).size();
}
boolean treatWithTopic = submitWholeTopic && !Strings.isNullOrEmpty(topic) && topicSize > 1;