Closed AnneGriff closed 3 days ago
I'm still not exactly sure of the answer but I have made the query much more efficient by changing (p11ff)-[r11fe:Spouse]->(p11fd:Person) to r11fe = (p11ff)-[:Spouse]->(p11fd:Person) which means I don't need the WITH statement. ... I was listening!
QUERY 1
is a short version of the one I have opened for your performance comments. It contains two OPTIONAL MATCH and works without a WITH statement. It also doesn't need the nodes specified on the RETURN statement for them to be displayed.
QUERY 2
Is a refined version, replacing the SHORTESTPATH with a more specific relationship. It has many OPTIONAL MATCH statements, but even when there are only a couple, it requires a WITH statement for parameters to be found on the RETURN statement.