rmagen/elastic-gremlin

Optimize search queries - id field select

eliranmoyal opened this issue · 4 comments

when searching for elements we know we will not be asked about (used only for traversal)
we can only request the id of those fields.
meaning
if we ask for g.V().has("name","X").inE("knows").next()
we can only get the id from the first query - but not for the 2nd one.

The logic suggested is : if from your search until the next search there are not steps of kind:
propertyStep,identitiyStep(as("x"))
and the step is not the last search step. get only the id from elastic.

isn't this a duplicate of #23?

this is a different optimization but probably have the same rules.
#23 talks about Vertex to Vertex queries which we don't need to really even fetch the vertices
here we talk about: when fetching the vertex/edge we could just fetch id field

got ya, okay

closed in favor of #47