Re: index not used for query


Anatoly Belikov <awbe...@...>
 

I figured out that indices not used only "withRemote" connection. Here is content of  config files:

# conf/remote-graph.properties
gremlin.remote.remoteConnectionClass=org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection
gremlin
.remote.driver.clusterFile=conf/remote-objects.yaml
gremlin
.remote.driver.sourceName=g

# conf/remote-objects.yam
hosts: [localhost]
port
: 8182
serializer
: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}

Is this difference in index usage is expected?

On Tuesday, 24 September 2019 16:56:43 UTC+3, Anatoly Belikov wrote:
Hello

I have made an index for vertex property "id", the index is enabled, but still it is not used for the query according to the profiler. Please, give me advice on how to make index work.

gremlin> vindex = mgmt.getGraphIndex("byId")
gremlin
> vindex.fieldKeys
==>id

mgmt
.awaitGraphIndexStatus(graph, vindex.name()).status(SchemaStatus.ENABLED).call()
==>GraphIndexStatusReport[success=true, indexName='byId', targetStatus=[ENABLED], notConverged={}, converged={id=ENABLED}, elapsed=PT0.001S]

gremlin
> g.V().has('id', '-9032656531829342390').profile()
==>Traversal Metrics
Step                                                               Count  Traversers       Time (ms)    % Dur
=============================================================================================================
JanusGraphStep([],[id.eq(-9032656531829342390)])                       1           1        2230.851   100.00
   
\_condition=(id = -9032656531829342390)
   
\_isFitted=false
   
\_query=[]
   
\_orders=[]
   
\_isOrdered=true
  optimization                                                                                
0.005
  optimization                                                                                
0.026
  scan                                                                                        
0.000
   
\_condition=VERTEX
   
\_query=[]
   
\_fullscan=true
                                           
>TOTAL                     -           -        2230.851  


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