Happy to report I may have solved the issue!
To limit the siblings that get searched for reserved = false
, I set up a subquery in the CALL
block.
CALL {
MATCH (origin { type: 'part', identifier: '182' })<-[:CHILD]-(parent)-[:CHILD]->(siblings)
RETURN siblings
}
WITH siblings
WHERE siblings.reserved = false
RETURN siblings
The query planner shows this searching about ~475 nodes for the boolean attribute, instead of ~50,000.