Reputation: 929
I'm trying to check whether there is an edge between v1 and v2.
g.V(v1).outE(label).as("e").inV().hasId(v2).select("e")
Since I have too many edges on my graph, its getting slower to get a result.
I have added some indexes but it did not help. What's the suitable index to run that query faster?
Upvotes: 1
Views: 99
Reputation: 46216
As discussed on a different question, you probably can't make that go faster as-is. You would need to use indices (and filters on those indices) around outE()
to reduce the number of edges you are traversing to limit the amount of filters on the inV()
.
If you have nothing to filter on besides edge label then you might consider denormalizing a bit and pushing some identifying value from the vertex to the edge and indexing that. Then it should get much faster to do your traversal because it's just this:
g.V(v1).outE().has('someId',v2)
Upvotes: 3