Re: Query Optimisation


hadoopmarc@...
 

Hi Vinayak,

Can you please try and format your code in a consistent way to ease the reading (even if the editor in this forum is not really helpful in this)? After manual reformatting, Query 1 and the first Query 3 are identical, so I stopped looking at the other queries after that.

I have one suggestion though. If you take one of the subclauses:
    outE().has('property1', 'edge1').limit(100).as('e').inV().has('property1', 'vertex1')

you do not seem interested in returning all v2 vertices. You can therefore limit the number of v2 vertices with:
    outE().has('property1', 'edge1').limit(100).as('e').local(inV().has('property1', 'vertex1').limit(1))

Also see: https://tinkerpop.apache.org/docs/current/reference/#local-step

Best wishes,   Marc

Join {janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.