Re: [Neo4j] Re: usefulness of using WITH instead of one big match/where

2014-01-21 Thread Javad Karabi
this is weird... in your example, you got the member node and piped it into the next portion, via: MATCH (me:Member {id: {member_id}}) WITH me, me.birth_year as birth_year im assuming this is so that the comparison on me.birth_year and other.birth_year can occur, without having the cross-path comp

Re: [Neo4j] Re: usefulness of using WITH instead of one big match/where

2014-01-21 Thread Michael Hunger
Yes, that's true. cross path meant from different segments of the path. Michael Am 21.01.2014 um 18:37 schrieb Javad Karabi : > ah... i think i know what you mean. > that is, that i am comparing me.birth_year, and other.birth_year, both of > which were part of the same path, so splitting it u

Re: [Neo4j] Re: usefulness of using WITH instead of one big match/where

2014-01-21 Thread Javad Karabi
ah... i think i know what you mean. that is, that i am comparing me.birth_year, and other.birth_year, both of which were part of the same path, so splitting it up like you did (via the WITH me.birth_year) did the trick? On Tuesday, January 21, 2014 11:31:24 AM UTC-6, Javad Karabi wrote: > > Mich

Re: [Neo4j] Re: usefulness of using WITH instead of one big match/where

2014-01-21 Thread Javad Karabi
Michael, awesome, thank you. just to make sure I understand correctly, in this case, when you say 'cross path comparison', what are the 2 paths you are referring to? On Tuesday, January 21, 2014 11:21:32 AM UTC-6, Michael Hunger wrote: > > Right, cross path comparisons are not yet used to short

Re: [Neo4j] Re: usefulness of using WITH instead of one big match/where

2014-01-21 Thread Javad Karabi
Michael, I apologize, I will send you a copy of the query + profile too. In my actual query, I am using a parameter of the cypher query: WHERE other.birth_year > (me.birth_year - {age_difference_range}) AND other.birth_year < (me.birth_year + {age_difference_range}) here is the relevant prof

Re: [Neo4j] Re: usefulness of using WITH instead of one big match/where

2014-01-21 Thread Michael Hunger
Right, cross path comparisons are not yet used to shortcut path-finding so if you rewrite your query to this, it will actually filter down the paths eagerly MATCH (me:Member {id: 11700}) WITH me, me.birth_year as birth_year MATCH (me)-[ra:preferred_store]->(s)<-[rb:preferred_store]-(other)-[rc:

Re: [Neo4j] Re: usefulness of using WITH instead of one big match/where

2014-01-21 Thread Javad Karabi
You will notice: "WHERE (Property(NodeIdentifier(),cached_available(71)) == Literal(1)" in the TraversalMatcher() portion, the very first function of the profile.. I believe that this is what is meant when the documentation says that the WHERE clause is not done after, (therefore during) the mat

Re: [Neo4j] Re: usefulness of using WITH instead of one big match/where

2014-01-21 Thread Javad Karabi
Mark, I have emailed you the query and profile for both cases. On Tuesday, January 21, 2014 10:55:03 AM UTC-6, Javad Karabi wrote: > > Mark, I would be happy to. Give me a moment and I will post them. > > Michael, > >- Kernel version > >neo4j-browser, version: 2.0.0 >- >

Re: [Neo4j] Re: usefulness of using WITH instead of one big match/where

2014-01-21 Thread Michael Hunger
The problem is cross-path expressions, which are not yet handled in that manner for simple expressions that only contain a single piece of the path (node, rel) and things that have been evaluated before (parameters, literals, previous computations) WILL be used to shortcut the path evaluation.

Re: [Neo4j] Re: usefulness of using WITH instead of one big match/where

2014-01-21 Thread Javad Karabi
Mark, I would be happy to. Give me a moment and I will post them. Michael, - Kernel version neo4j-browser, version: 2.0.0 - On Tuesday, January 21, 2014 10:49:37 AM UTC-6, Michael Hunger wrote: > > Java, what version are you using? > > 2.0 final? > > Michael > > Am 21.01.20

Re: [Neo4j] Re: usefulness of using WITH instead of one big match/where

2014-01-21 Thread Michael Hunger
Java, what version are you using? 2.0 final? Michael Am 21.01.2014 um 17:29 schrieb Javad Karabi : > from what I can tell, if there where clause is ">" or "<" (as it is in the > actual query which i am using, not in this example query...) then the WHERE > predicate _is in fact_ a filter, appl

Re: [Neo4j] Re: usefulness of using WITH instead of one big match/where

2014-01-21 Thread Mark Needham
Javad, Can you paste the PROFILE output for the two queries on here. In theory the two queries should do the same thing...in practice I imagine that's not the case! Mark On 21 January 2014 16:29, Javad Karabi wrote: > from what I can tell, if there where clause is ">" or "<" (as it is in the

[Neo4j] Re: usefulness of using WITH instead of one big match/where

2014-01-21 Thread Javad Karabi
from what I can tell, if there where clause is ">" or "<" (as it is in the actual query which i am using, not in this example query...) then the WHERE predicate _is in fact_ a filter, applied _after_ the match. It looks to me that "TraversalMatcher()" does not apply predicates which involve > or