Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-30-2019 02:14 AM
Hi, everyone
I am writing a query that returns a relationship according to the attributes of two nodes.
MATCH (a:nodeLabel)-[r:relationType]-(b:nodeLabel) WHERE a.attribute=nodeA AND b.attribute=nodeB RETURN r
There are about one million pairs of nodes. I used for loop to execute this query for each node pair in python and it took so much long time. I thought I can query relationships between million pairs of nodes in one query. But I did not find a solution. Any suggestions?
Many thanks for any help!
09-30-2019 05:44 AM
if you prefix the query with EXPLAIN
does this report it using an INDEX scan or is it using a scan by LABEL.
Do you have indexes on :nodeLabel and specifically on property attribute
10-04-2019 01:13 AM
I have indexes specifically on property attribute. The query does use an INDEX scan.
When I execute one query. it took 5ms. But I have millions of queries.
10-04-2019 04:02 AM
the query plan looks great and I'm not sure where I see it could be improved. and 5ms for a response/output would appear very fast.
isnt the issue now a matter of not the response time of the individual query but rather the number of times it runs
All the sessions of the conference are now available online