What is the difference between multiple MATCH clauses and a comma in a Cypher query?

后端 未结 5 692
死守一世寂寞
死守一世寂寞 2021-02-01 02:43

In a Cypher query language for Neo4j, what is the difference between one MATCH clause immediately following another like this:

MATCH (d:Document{document_ID:2})
         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-01 02:50

    If a part of a query contains multiple disconnected patterns, this will build a cartesian product between all those parts. This may produce a large amount of data and slow down query processing. While occasionally intended, it may often be possible to reformulate the query that avoids the use of this cross product, perhaps by adding a relationship between the different parts or by using OPTIONAL MATCH (identifier is: (a)) . IN short their is NO Difference in this both query but used it very carefully.

提交回复
热议问题