Skip to content
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

Improvement Request: Let EXISTS() on patterns use getDegree(), if able #9054

Closed
InverseFalcon opened this issue Mar 17, 2017 · 2 comments
Closed

Comments

@InverseFalcon
Copy link

This requests an improvement to EXISTS(). Current EXISTS() performs expansion to verify if the pattern exists or not.

However, when run on certain patterns, EXISTS() should be able to optimize execution by checking the degree of a relationship.

For example:

PROFILE MATCH (p:Person{name:'Keanu Reeves'})
RETURN p, EXISTS((p)-[:ACTED_IN]->()) as actor

is more expensive than this:

PROFILE MATCH (p:Person{name:'Keanu Reeves'})
RETURN p, SIZE((p)-[:ACTED_IN]->()) <> 0 as actor

yet it's exactly the same kind of query. If EXISTS() can be optimized to take advantage of situations like these where a degree check could be performed instead, it would be a nice quality of life improvement.

@InverseFalcon
Copy link
Author

It would also be great if the same kind of enhancement could be made on WHERE <pattern> clauses too.

@InverseFalcon
Copy link
Author

InverseFalcon commented Jul 7, 2017

Noting that 3.2.0 addresses this request, though the WHERE clause with just the pattern and not using EXISTS still doesn't use the relationship degree.

Closing since the EXISTS optimization has been addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants