[ https://issues.apache.org/jira/browse/TINKERPOP-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17715508#comment-17715508 ]
Valentyn Kahamlyk commented on TINKERPOP-2490: ---------------------------------------------- this behavior is part of `CountStrategy` optimization and it looks correct. how can you read only 1 vertex to know that there are less than 2 of them? > RangeGlobalStep touches next traverser when high limit is already hit > --------------------------------------------------------------------- > > Key: TINKERPOP-2490 > URL: https://issues.apache.org/jira/browse/TINKERPOP-2490 > Project: TinkerPop > Issue Type: Bug > Components: process > Affects Versions: 3.4.8 > Reporter: Guo Junshi > Priority: Major > > In FilterStep, the processNextStart() method will first retrieve next > traverser and then apply filtering logic. But for RangleGlobalStep, if high > limit is already hit, there will be no need to get next traverser. > {code:java} > @Override > protected Traverser.Admin<S> processNextStart() { > while (true) { > final Traverser.Admin<S> traverser = this.starts.next(); > if (this.filter(traverser)) > return traverser; > } > } > {code} > An example would be limit step: g.V().limit(1). This query will touch 2 > vertices although only 1 vertex will be returned. > This extra data loading will cause performance defects if DB data loading is > involved. It is not a functionality bug, but for better performance, we'd > better check high range limit first before touching next traversal. -- This message was sent by Atlassian Jira (v8.20.10#820010)