bjlevine
bjlevine

Reputation: 984

Clarification on multiple MATCH and WHERE clauses

I have question about the following statement from the Neo4j manual:

In the case of multiple (OPTIONAL) MATCH clauses, the predicate in WHERE is always a part of the patterns in the directly preceding MATCH. Both results and performance may be impacted if the WHERE is put inside the wrong MATCH clause.

Does this mean that I just need to be careful to keep to do:

MATCH clauseA WHERE predicateA
MATCH clauseB WHERE predicateB

rather than

MATCH clauseA, clauseB WHERE predicateA AND predicateB

Upvotes: 1

Views: 76

Answers (1)

cybersam
cybersam

Reputation: 66999

Yes, that is what it means. And the same thing applies to OPTIONAL MATCH.

Upvotes: 2

Related Questions