[ 
https://issues.apache.org/jira/browse/TINKERPOP-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17247743#comment-17247743
 ] 

ASF GitHub Bot commented on TINKERPOP-2490:
-------------------------------------------

junshiguo closed pull request #1370:
URL: https://github.com/apache/tinkerpop/pull/1370


   


----------------------------------------------------------------
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:
us...@infra.apache.org


> 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.3.4#803005)

Reply via email to