[Neo4j] Question about cypher prepared queries

2011-12-06 Thread jschweigl
I have a class with one String field to hold a query string and one for a
compiled query which is created in the constructor. So, each instance has
the query string (for documentation purposes) and the compiled query. 

Does CypherParser return the same Query instance for parse()'s with
indentical input strings or is a new one created every time? Or, asked the
other way round: do I lose any of the advantages of precompiled queries when
I compile the same query string several times at different places in the
code?

Ah, btw, would be nice if one could ask a compiled Query instance for the
query source from which it has been compiled ...


--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Question-about-cypher-prepared-queries-tp3564339p3564339.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Question about cypher prepared queries

2011-12-06 Thread Andres Taylor
On Tue, Dec 6, 2011 at 2:27 PM, jschweigl johann.schwe...@gmail.com wrote:

 I have a class with one String field to hold a query string and one for a
 compiled query which is created in the constructor. So, each instance has
 the query string (for documentation purposes) and the compiled query.

 Does CypherParser return the same Query instance for parse()'s with
 indentical input strings or is a new one created every time? Or, asked the
 other way round: do I lose any of the advantages of precompiled queries
 when
 I compile the same query string several times at different places in the
 code?


There is no query cache in place right now. Once it's in place, you'll get
the same query object every time you parse the same string.

Ah, btw, would be nice if one could ask a compiled Query instance for the
 query source from which it has been compiled ...


Of course it should. Why didn't I think of that?

It's been done in the Scala code now. I'll create the Javacompat equivalent
ASAP.

Andrés
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user