So it seems that when having a relation pattern in MATCH, the OR clause will not hit any one index(If we have two separate label index). I think it is actually what i want to know about the inner logic of cypher parse and index process.
I have tried the UNION clause and it realy works. However i wonder it may be a little cumbersome if we have complex relationship / pattern or many clauses mixed with AND / OR.
Hope keeping in touch! :wink:
I've been testing some variations to the query without the type of results you are expecting. Talking from my experience, Cypher will try to enforce a linear planing in order to avoid Joints and cartesian products. OR conditions will always be tricky because they will logically try to split the pipeline but Cypher will mostly try to guarantee the conditions during a filter step.
You can always split the pipeline with UNION,knowing that doing so you will get better performance on individuals branches. My suggestion, stick to the UNION. By the time you get into more complex queries you will have experience enough to decide what's better.