cypher 2.2 cost-planner & write ops

17 views
Skip to first unread message

Thomas Baum

unread,
Apr 12, 2015, 4:50:44 PM4/12/15
to ne...@googlegroups.com

First at all, you (the neo-developers) did a great job in 2.2!
The new cypher cost-planner is amazing. Executing a query rule-based takes 16 seconds, and in the new cost-based planner it’s down to <1 second.  AWESOME!!


But there is one little thing. I try to mix writing operations and read-ops, but it seems not to use the cost-planner?

  db.execute("CYPHER 2.2 PLANNER COST " +
             "MATCH (rundgangVorlage) WHERE id(rundgangVorlage)={rundgangVorlage} " +
             "MATCH (rundgangVorlage)-[:BEREICH]->(:Bereich)-[:FRAGE*1..]->(:Frage)<-[:PRUEFEN]-(pruefNode:Pruefung) " +
             "MATCH (rundgangVorlage)<-[:IN_RUNDGANG]-()-[:HAS_ORT*0..]->()-[:PRUEFEN]->(pruefNode) " +
             "WITH pruefNode " +
             "MATCH (rundgang) WHERE id(rundgang)={rundgang} " +
             "MERGE (rundgang)<-[:AKTIV]-(pruefNode) " +
             "RETURN count(pruefNode) as count",
        map("rundgangVorlage", asNodeId(), "rundgang", rundgangNode.getId());


doing the write operation externally like

  db.execute("CYPHER 2.2 PLANNER COST " +
             "MATCH (rundgangVorlage) WHERE id(rundgangVorlage)={rundgangVorlage} " +
             "MATCH (rundgangVorlage)-[:BEREICH]->(:Bereich)-[:FRAGE*1..]->(:Frage)<-[:PRUEFEN]-(pruefNode:Pruefung) " +
             "MATCH (rundgangVorlage)<-[:IN_RUNDGANG]-()-[:HAS_ORT*0..]->()-[:PRUEFEN]->(pruefNode) " +
             "RETURN pruefNode ",
        map("rundgangVorlage", asNodeId()))
        .columnAs("pruefNode")
        .forEachRemaining(node -> ((Node)node).createRelationshipTo(rundgangNode, RelTypes.AKTIV));


works great. any ideas?

cheers, Thomas




sorry for the german-cypher, just copied it from real code ;)

Axel Morgner

unread,
Apr 12, 2015, 5:47:28 PM4/12/15
to ne...@googlegroups.com
Hi Thomas,

FWIK, write ops (read-write and write-only) are not yet handled by Ronja, see this statement from the "Future work" section of this great blog post: "We shall also be integrating Ronja into the read-write and write-only queries so that they execute much more rapidly in the future."

Source: http://neo4j.com/blog/introducing-new-cypher-query-optimizer/

Cheers
Axel
--
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 neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Axel Morgner · CEO Structr (c/o Morgner UG) · Twitter @amorgner · Skype axel.morgner
Hanauer Landstr. 291a · 60314 Frankfurt, Germany · Phone +49 151 40522060
https://structr.org - Structr: The Game-Changing Software based on Neo4j
https://structr.com - Structr and Neo4j Hosting
Reply all
Reply to author
Forward
0 new messages