0

I'm new to gremlin and I'm trying to optimize the query. Any ideas what can be done?

traversal = graph.V(fromID).toE(toID)

traversal.project(1KEY, 2KEY)
.by(valueMap().with(WithOptions.tokens))
.by(outV().valueMap().with(WithOptions.tokens))
.by(inV().valueMap().with(WithOptions.tokens));
Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
Stacy
  • 43
  • 7
  • Can you explain a bit more about what you're attempting to do with this query? Are you trying to fetch an edge, all of the edge's properties, and then all related information for the "from" and "to" vertex of that edge? – Taylor Riggan Aug 18 '22 at 19:33
  • Adding to the question above, when you say optimize, is it performing poorly? How many nodes is it having to return? `valueMap` is going to return every property for each node found. Neptune has a profile API that will give you a bit more insight into where time is being spent and how much data is being touched. – Kelvin Lawrence Aug 18 '22 at 23:00

0 Answers0