I have the following data structure:
- Order -> Contact -> Install -> Campaign
- Order -> Contact -> Download -> Campaign
I have created the following Cypher Query:
MATCH (ca1:Campaign) - [CI] - (i:Installs) - [IC] - (co1:Contact) - [CO1] - (o1:Order),
(ca2:Campaign) - [CD] - (d:Downloads) - [DC] - (co2:Contact) - [CO2] - (o2:Order)
where i.DownloadDate > '6/1/16' and i.DownloadDate < '7/31/16'
and d.DownloadDate > '6/1/16' and d.DownloadDate < '7/31/16'
RETURN ca1,CI,i,IC,co1,CO1,o1,ca2,CD,d,DC,co2,CO2,o2 limit 50
CQ is giving the following waring:
This query builds a cartesian product between disconnected patterns. 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 (identifiers are: (ca2, d, co2, o2))
Is there a better way to code in CQL?. (Sorry for the newbie question). Thanks.