I am very new to neo4j graph DB. in my current project, it need to have multiple duplicate relations between two nodes but with the different properties(minimum two properties which contain text values) and relationship label will be the same.
first i created 21 nodes with 24 relations and run a query to get all paths between two nodes without travel one node twice.
this is the query I executed.
MATCH p=(a)-[*]-(b) WHERE id(a)=10 AND id(b)=11 AND NONE (n IN nodes(p) WHERE size([x IN nodes(p) WHERE n = x])> 1) RETURN p
this was executed properly without delaying.
but after i added multiple duplicate relations between several nodes(another 12 relations have been added ) and again executed this query. then it took around 15 mins to complete and the given results are correct. any help to rectify this issue highly appreciate.
later i've added unique constraint and index on id and name properties but there were no improvements.
below i've added profile and explain results of the query.