Improve gremlin traversal query performance
I would like to start from a particular source node ( id = 01F546'), traverse both direction for x number (4 in the below example) of hops , and list the properties of the first 200 destination nodes meeting certain creteria ( 'type' = output' in the below sample). I have set up the timeLimt to make sure the query return before time out.
I have created composite/mixed indexes on 'id', 'type' each.
For a graph of 250k nodes and 400k edges, the above query takes about ~7 second via gremline query console. What can be done to speed up the performance?
Thank you
Gremlin query & profile() results are as below
g.V().
has('id', eq('01F546')).emit().
repeat(bothE().otherV().timeLimit(300000)).times(4).
has('type', eq('output')).
map(properties().group().by(key()).by(value())).
dedup().
limit(200).
toList()
The output of the profile is:
HasStep([type.eq(output)]) 17 17 627.249 90.79
TraversalMapStep([JanusGraphMultiQueryStep, Jan... 17 17 3.129 0.45
JanusGraphMultiQueryStep 17 17 0.207
JanusGraphPropertiesStep(property) 180 180 1.520
\_condition=(PROPERTY AND visibility:normal)
\_orders=[]
\_isFitted=true
\_isOrdered=true
\_query=SliceQuery[0x40,0x60)
\_multi=true
\_vertices=1
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
GroupStep(key,[PropertyValueStep]) 17 17 1.204
PropertyValueStep 180 180 0.279
DedupGlobalStep(null,null) 11 11 0.202 0.03
RangeGlobalStep(0,20) 11 11 0.151 0.02
>TOTAL - - 690.901 -
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.000
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.000
optimization 0.001
optimization 0.000
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.001
optimization 0.000
optimization 0.000
optimization 0.000
optimization 0.001
optimization 0.000
optimization 0.000
GroupStep(key,[PropertyValueStep]) 109 109 6.813
PropertyValueStep 1083 1083 1.854
DedupGlobalStep(null,null) 76 76 0.610 0.01
>TOTAL - - 6721.808 -
Comments
Post a Comment