-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Optimisation? Semantics? Consecutive (predicate-free) varLength pattern elements. #12081
Comments
Good idea, thanks for the input. We will consider it for future development. |
Hi @Izhaki Thank you for this interesting corner case. As this is such a narrow use case I feel that our performance efforts are better spent on other things, also given that it is easy to hand optimize a query from one form to the other if it is a bottleneck for some use case. If you are interested in the subtle nuances of patterns, I encourage you to participate in the ongoing OpenCypher work around path patterns opencypher/openCypher#187, which is essentially about extending Cypher patterns with regex-like functionality. |
Environment
Background
Description
Consider:
The plan will include two
VarLengthExpand(All)
operators:Which is rather bonkers.
Also note the result:
This is correct, but why would anyone like to do this?
This query can be rewritten as:
Which is more efficient, and it only produces distinct paths:
I'm sure you'll also be able to work out the arithmetic for queries like this:
Anyhow, given the results are different, perhaps this is more of a case of semantics rather than optimisation.
The text was updated successfully, but these errors were encountered: