Sumit Kumar
Sumit Kumar

Reputation: 760

How to minimise time for any operation in janusgraph using gremlin?

For any query, it is taking more than five minutes to give result. I am running simple query like as following

g.V().hasLabel("Label").has("pProperty","vValue").next()

When I have lesser number of nodes it was working fine but now I have more than 1 million nodes, so the issue arises.

Upvotes: 1

Views: 131

Answers (2)

Aaron
Aaron

Reputation: 57748

Seconding what Kelvin said about adding an index. To make things more-efficient, you'll either need to filter on additional indexed properties, or make sure that you're designating an appropriate "entry point" for your traversal.

Upvotes: 1

Kelvin Lawrence
Kelvin Lawrence

Reputation: 14371

When using JanusGraph and a Gremlin query to search for a property, if no index has been created for that property the query becomes a full scan over the data. Simple and composite indices can be created using the JanusGraph Management API. The Gremlin profile() step will show you if your query used an index.

Upvotes: 3

Related Questions