Hi here is my code
MATCH (parent:PART {category:'SKU',part_id:'400695-01'})
MATCH (child:PART)-[r:belongs_to*0..10]->(parent)
return parent.part_id, count(child.part_id) as part_count
This gives me the execution profile on the right, which takes very long
when I lower the varlength path to 9, the query suddenly becomes much faster
MATCH (parent:PART {category:'SKU',part_id:'400695-01'})
MATCH (child:PART)-[r:belongs_to*0..9]->(parent)
return parent.part_id, count(child.part_id) as part_count
and now the execution profile becomes the one on the left which is much faster.
Anyone knows why the execution plan changes this drastically when I change the variable length path from 10 to 9.