I have been using JanusGraph 0.4, Cassandra 2.2.10 and Solr-7.0.0 to query a property graph of about
. This graph was generated using LDBC benchmark.
-------------------------------------------------------------------------------------------------------
gremlin.graph=org.janusgraph.core.JanusGraphFactory
storage.backend=cassandrathrift
storage.hostname=10.0.0.254,10.0.0.1,10.0.0.2,10.0.0.5,10.0.0.6,10.0.0.15,10.0.0.16,10.0.0.17,10.0.0.18
storage.cassandra.keyspace=10k_DW
storage.batch-loading=true
storage.read-time=600000
storage.cassandra.thrift.cpool.min-evictable-idle-time=600000
storage.transactions=false
storage.cassandra.frame-size-mb=128
storage.cassandra.write-consistency-level=ANY
storage.cassandra.read-consistency-level=ONE
schema.default=none
schema.constraints=false
index.search.backend=solr
index.search.solr.mode=cloud
index.search.solr.zookeeper-url=10.0.0.254:21181
index.search.solr.configset=janusgraph-configset
cache.db-cache=true
cache.db-cache-clean-wait = 20
cache.db-cache-time = 180000
cache.db-cache-size = 0.25
----------------------------------------------------------------------------------------------------------
I loaded the graph using BulkVertexLoaderProgram which also created the index.
==>------------------------------------------------------------------------------------------------
Vertex Label Name | Partitioned | Static |
---------------------------------------------------------------------------------------------------
Post | false | false |
Forum | false | false |
Person | false | false |
Comment | false | false |
---------------------------------------------------------------------------------------------------
Edge Label Name | Directed | Unidirected | Multiplicity |
---------------------------------------------------------------------------------------------------
edges | true | false | MULTI |
---------------------------------------------------------------------------------------------------
Property Key Name | Cardinality | Data Type |
---------------------------------------------------------------------------------------------------
title | SINGLE | class java.lang.String |
birthday | SINGLE | class java.lang.String |
lastName | SINGLE | class java.lang.String |
gender | SINGLE | class java.lang.String |
city | SINGLE | class java.lang.String |
vertexType | SINGLE | class java.lang.String |
edgeType | SINGLE | class java.lang.String |
joinDate | SINGLE | class java.lang.String |
continent | SINGLE | class java.lang.String |
country | SINGLE | class java.lang.String |
endDate | SINGLE | class java.lang.Integer |
length | SINGLE | class java.lang.String |
creationDate | SINGLE | class java.lang.String |
startDate | SINGLE | class java.lang.Integer |
hasTag | SINGLE | class java.lang.String |
---------------------------------------------------------------------------------------------------
Vertex Index Name | Type | Unique | Backing | Key: Status |
---------------------------------------------------------------------------------------------------
bybirthday | Mixed | false | search | birthday: ENABLED |
bylastName | Mixed | false | search | lastName: ENABLED |
bygender | Mixed | false | search | gender: ENABLED |
bycity | Mixed | false | search | city: ENABLED |
byvertexType | Mixed | false | search | vertexType: ENABLED |
byjoinDate | Mixed | false | search | joinDate: ENABLED |
bycontinent | Mixed | false | search | continent: ENABLED |
bycountry | Mixed | false | search | country: ENABLED |
byendDateV | Mixed | false | search | endDate: ENABLED |
bylength | Mixed | false | search | length: ENABLED |
bycreationDate | Mixed | false | search | creationDate: ENABLED |
bystartDateV | Mixed | false | search | startDate: ENABLED |
byhasTag | Mixed | false | search | hasTag: ENABLED |
bytitle | Mixed | false | search | title: ENABLED |
---------------------------------------------------------------------------------------------------
Edge Index (VCI) Name | Type | Unique | Backing | Key: Status |
---------------------------------------------------------------------------------------------------
byedgeType | Mixed | false | search | edgeType: ENABLED |
byendDateE | Mixed | false | search | endDate: ENABLED |
bystartDateE | Mixed | false | search | startDate: ENABLED |
---------------------------------------------------------------------------------------------------
Relation Index | Type | Direction | Sort Key | Order | Status |
---------------------------------------------------------------------------------------------------
I ran the following query in the gremlin console along with profiling and it took about 130s. Without profiling enabled, the times were similar (120s avg).
gremlin> g.V().has('vertexType', 'Person').has('hasTag', textContainsRegex('.*Victor_Hugo.*')).inE().where(has('edgeType', 'post_hasCreator_person').or().has('edgeType', 'comment_hasCreator_person')).has('startDate', gt(554400)).outV().where(has('vertexType', 'Comment').or().has('vertexType', 'Post')).count().profile()
==>Traversal Metrics
Step Count Traversers Time (ms) % Dur
=============================================================================================================
JanusGraphStep([],[vertexType.eq(Person), hasTa... 215 215 3850.841 2.80
\_condition=(vertexType = Person AND hasTag textContainsRegex .*Victor_Hugo.*)
\_orders=[]
\_isFitted=true
\_isOrdered=true
\_query=[(hasTag_t textContainsRegex .*Victor_Hugo.*)]:byhasTag
\_index=byhasTag
\_index_impl=search
optimization 0.031
optimization 0.662
backend-query 4829 1665.018
\_query=byhasTag:[(hasTag_t textContainsRegex .*Victor_Hugo.*)]:byhasTag
backend-query 8990 135240.732
\_query=byvertexType:[(vertexType_s = Person)]:byvertexType
JanusGraphVertexStep([startDate.gt(554400), edg... 108671 108671 6791.413 4.95
\_condition=(startDate > 554400 AND (edgeType = post_hasCreator_person OR edgeType = comment_hasCreator_pe
rson) AND EDGE AND visibility:normal)
\_orders=[]
\_isFitted=false
\_isOrdered=true
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
\_vertices=1
optimization 12.935
backend-query 1508 28.361
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.338
backend-query 2867 33.046
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.129
backend-query 330 8.528
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.140
backend-query 389 4.054
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.066
backend-query 1612 16.619
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.212
backend-query 336 12.616
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.125
backend-query 1158 12.768
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.121
backend-query 653 4.939
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.127
backend-query 3558 25.587
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.092
backend-query 1188 9.369
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.118
backend-query 147 2.547
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.082
backend-query 2334 15.543
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.095
backend-query 186 3.875
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.052
backend-query 1062 8.590
####################Similar Lines (Truncated)##############################
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.047
backend-query 2103 13.012
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.043
backend-query 54 1.771
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.049
backend-query 2936 16.540
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.044
backend-query 810 5.520
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.035
backend-query 3393 17.706
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.044
backend-query 1316 8.737
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
optimization 0.040
backend-query 2179 13.790
\_query=org.janusgraph.diskstorage.keycolumnvalue.SliceQuery@801a60ee
EdgeVertexStep(OUT) 108671 108671 143.822 0.10
HasStep([vertexType.or(eq(Comment), eq(Post))]) 108671 108671 126282.583 91.96
CountGlobalStep 1 1 256.228 0.19
>TOTAL - - 137324.888 -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Please let me know if this is an expected query time (at least at the ballpark) for the given graph, setup and query.
Also, if someone has any ideas to improve the performance for this scenario, it would be much helpful.
Thanks.