Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Query planner can't see through WITH alises to indexable properties #12356
It seems the Neo4j query planner can't 'see through'
Given a sample graph:
While the following query with a redundant
Aliasing the variable in the
It's as if the optimiser's forgotten/doesn't realise that
Aliasing in the
The optimiser doesn't consider the unique index and does a NodeByLabel scan instead.
This is not strictly speaking a bug since you get the correct result for your query, but I agree that the planner could be smarter about this. It is not a quick fix, but we have added it to our backlog of performance improvements.