0

Hi I am traversing a graph using gremlin and my query is following

g.V().match(
  __.as("BaseVehicle").outE("year").as("year"),
  __.as("BaseVehicle").outE("make").as("make"),
  __.as("BaseVehicle").outE("model").as("model"),
  __.as("year").has("Year","1982"),
  __.as("make").has("MakeName","BMW"),
  __.as("model").has("ModelName","R65")
).select("BaseVehicle").by("BaseVehicleID")

Its taking aprox. 20 Sec to execute . why its taking so much time?

Schema is following

   schema.propertyKey("BaseVehicle").Int().single().create()
    schema.propertyKey("ModelName").Text().single().create()
    schema.propertyKey("YearID").Int().single().create()
    schema.propertyKey("MakeID").Int().single().create()
    schema.propertyKey("BaseVehicleID").Int().single().create()
    schema.propertyKey("Year").Int().single().create()
    schema.propertyKey("MakeName").Text().single().create()
    schema.propertyKey("ModelID").Int().single().create()
    schema.edgeLabel("year").multiple().properties("BaseVehicle", "Year").create()
    schema.edgeLabel("model").multiple().properties("ModelName", "BaseVehicle").create()
    schema.edgeLabel("make").multiple().properties("MakeName", "BaseVehicle").create()
    schema.vertexLabel("BaseVehicle").properties("BaseVehicleID").create()
    schema.vertexLabel("BaseVehicle").index("byBaseVehicleID").materialized().by("BaseVehicleID").add()
    schema.vertexLabel("Year").properties("YearID").create()
    schema.vertexLabel("Year").index("byYearID").materialized().by("YearID").add()
    schema.vertexLabel("Year").index("YearByBaseVehicle").inE("year").by("Year").add()
    schema.vertexLabel("Model").properties("ModelName", "ModelID").create()
schema.vertexLabel("Model").index("byModelID").materialized().by("ModelID").add()
    schema.vertexLabel("Model").index("ModelByBaseVehicle").inE("model").by("ModelName").add()
    schema.vertexLabel("Make").properties("MakeName", "MakeID").create()
    schema.vertexLabel("Make").index("byMakeID").materialized().by("MakeID").add()
    schema.vertexLabel("Make").index("MakeByBaseVehicle").inE("make").by("MakeName").add()
    schema.edgeLabel("year").connection("BaseVehicle", "Year").add()
    schema.edgeLabel("model").connection("BaseVehicle", "Model").add()
    schema.edgeLabel("make").connection("BaseVehicle", "Make").add()
stephen mallette
  • 45,298
  • 5
  • 67
  • 135

1 Answers1

0

Will you please run this query using the .profile() item to understand the bottleneck? Also, what does your hardware look like? And, how many Vertices and Edges do you have?

jlacefie
  • 614
  • 3
  • 5
  • I have aprox 3 lac vertices and 22 lac edges. from .profile() i can see first query optimiser and first MatchStartStep is taking almost 95% time of query. – Rajni Kant Sharma Oct 17 '16 at 06:25
  • Rajni, was this resolved for you? Otherwise can you contact Diego, the startup account manager, so we can continue this over email? – peytoncas Nov 14 '16 at 23:46