Help in making the query more efficient

15 views
Skip to first unread message

Divya Saxena

unread,
Aug 23, 2016, 3:46:50 PM8/23/16
to ne...@googlegroups.com
Hi,
Can someone help me in making the following query more efficient.


MATCH n=(node1:Node1)<-[:RELATION1]-(node2:Node2)
WHERE node2.entity2 IN ['ABC','LMN','PQR']
AND node1.entity1 IN ['XYZ'] WITH COUNT(n) as nCount
MATCH (node11:Node1)<-[:RELATION1]-(node21:Node2)
WHERE node2.entity2 IN ['ABC','LMN','PQR']
AND (node11.entity1 IN ['XYZ'] AND nCount = 0)
MATCH (node12:Node1)-[:RELATION2]->(node3:Node3)<-[:RELATION1]-(node22:Node2)
WHERE (node3.entity3 >= 5 OR node3.entity3 <= 70
AND (node12.entity1 IN ['XYZ'] OR node12.entity1 IN ['XYZ']))
MATCH (node4:Node4{entity1 : 'PPP'})
WHERE none (condition0 IN ['AAA']
WHERE condition0 IN ['BBB']) OR ('AAA' IN ['BBB']
AND 1471888050 < timestamp()) RETURN node4

Michael Hunger

unread,
Aug 24, 2016, 4:05:28 PM8/24/16
to ne...@googlegroups.com
Can you share the current query plan that you get when you prefix your query with PROFILE

Also the size and structure of your datastore
and the output of :schema to list existing indexes and constraints.
> --
> You received this message because you are subscribed to the Google Groups "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages