-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of Neo4j indices for HasLabel/Has traversals #46
Comments
Yes, gremlin traversals do not use indices on the neo4j database. The reason for this behavior is that this project is an OLTP implementation of the gremlin API. To be able to use the full power of neo4j from gremlin we need to implement the OLAP API. Help is welcome in case you are interested... |
I am facing same issue. I have below query Please let me know if we can increase query performance. I am using gremlin console 3.3.2 version |
Tried beow steps
got the reason it is because of using has label and "and" operator. it started using indices |
The reason for this behavior is that this project is an OLTP implementation of the gremlin API. To be able to use the full power of neo4j from gremlin we need to implement the OLAP API. None of the gremlin queries you are issuing will use indexes, all they are doing is loading the graph in memory and doing a client side filter. Look at the documentation on how to enable profiling in this library and you will see this behavior. |
When I used normal those are very slow on gremlin console. As soon I used subgraph starteagy and using "has label , "and" operator" got results very fast. So strategies are contributing in traversal? Is there any OLAP api implementation in .net which i can reuse? |
Hi, On enabling profiler it is giving me this output: 2018-10-03 16:04:05.598 INFO 7311 --- [nio-8080-exec-1] c.s.o.n.s.summary.ResultSummaryLogger : Profile for CYPHER statement: Statement{text='PROFILE MATCH (n) RETURN n', parameters={}} +-----------------+----------------+------+---------+-----------+-------+ Why is gremlin not using indexes. Please help If I am missing something, please show me the correct way |
Same response as before in this thread. This library only implements the Gremlin structure interfaces. You need to use CYPHER like: Iterator<Vertex> vertices = graph.vertices("MATCH (n:User) WHERE ID(n)={id} RETURN n", Collections.singletonMap("id", 123123)); |
You can count me in , in case you are looking for a contributor |
Sure, feel free to send PR with implementation. we can discuss it and collaborate on the PR. |
I think it should be a part of OLTP implementation only to make use of indices while using haslabel / has step. It should not be done in OLAP implementation. |
I see that traversals with HasLabel/Has steps are not making use of the existing indices on the nodes. Comparing the traversal plans of this plugin and the Gremlin plugin by Thinkaurelius (https://github.com/thinkaurelius/neo4j-gremlin-plugin), it seems that it is not using a strategy similar to org.apache.tinkerpop.gremlin.neo4j.process.traversal.strategy.optimization.Neo4jGraphStepStrategy to fold the HasLabel/Has conditions into the V() step.
Unfortunately, the Thinkaurelius plugin only works for Neo4j 2.x. Is there anything that can be done to incorporate the use of indices into the traversal plan? Thanks!!
The text was updated successfully, but these errors were encountered: