The following query is that I use to check existence of an edge between the 
two nodes, n1 and n2.

It seems the query costs a lot.

Is this optimized or not? Is there a better way to find it out?

String query = String.format("START n1=node(%d), n2=node(%d) WHERE 
n1-[:%s]-n2 RETURN count(*) as count_edges", nodeId1, nodeId2, edgeType);


ExecutionResult result = engine.execute(queryString);
int countEdges = Integer.valueOf(result.columnAs("count_edges").next().
toString());
        
if (countEdges > 0)
  return true;
                
return false;

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to