How to make the query below work seconds instead of minutes?
I'm new to graph databases. Am I right if I say that node indexing won't help to speed up my query? As I understand, indexes helps to find start point of traversal, not for traversing itself.
May relationship indexing be helpful in my case?
Query
I have 2,500 nodes of type COLUMN and 52,000 relationships between nodes.
The query below is too slow, I even don't know how slow is it. It takes more than 5 minutes, than I get java.net.SocketTimeoutException.
Query
MATCH path = (start:PERSON)-[r:MET_REL*2..5]->(person:PERSON)
WHERE start.ID = '385'
WITH path UNWIND NODES(path) AS col
WITH path,
COLLECT(DISTINCT col.COUNTRY_ID) as distinctCountries
WHERE LENGTH(path) + 1 = SIZE(distinctCountries)
RETURN path
P.S.
Moreover, I want to do [r:MET_REL*2..25] instead of [r:MET_REL*2..5]
PROFILE- Michael Hunger