Index not being use


Rohit Jain <rohit.j...@...>
 

Hi folks,

So I created an index like so:

gremlin> graph.tx().rollback()
==>null
gremlin> mgmt = graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@6843fdc4
gremlin> personid = mgmt.getPropertyKey('personid')
==>personid
gremlin> mgmt.buildIndex('personid', Vertex.class).addKey(personid).unique().buildCompositeIndex()
==>personid
gremlin> mgmt.commit()
==>null

Then I do a query like so, and it gives me a warning that I should use indexes.  Isn't the index use not implicit?  Do I have to do anything specific for it to use the index I just created?

gremlin> g.V().has('personid','640').out('role').inE('role').has('roletype',eq("director")).outV().values('personid')
13:14:45 WARN  org.janusgraph.graphdb.transaction.StandardJanusGraphTx  - Query requires iterating over all vertices [(personid = 640)]. For better performance, use indexes
==>7735

Rohit

Join {janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.