[Neo4j] Very slow cypher query, how to optimize it ?

2016-03-15 Thread Michael Azerhad
Using Neo4J 2.1.5. Data: - 2000 Persons - KNOWS relationships between some of them Goal of the query: For each person, display her fullname + amount of friends + amount of friends' friends + amount of friends' friends' friends. MATCH (person:Person) WITH person OPTIONAL MATCH

Re: [Neo4j] Very slow cypher query, how to optimize it ?

2016-03-15 Thread Michael Azerhad
Yes, but it would never be counted as a friend of friend. On Wednesday, March 16, 2016 at 12:28:44 AM UTC+1, Michael Hunger wrote: > > your shortest-path doesn't imply that it's not the same person. > > Robert would also be counted as direct friend. > > On Wed, Mar 16, 2016 at 12:25 AM, Michael

Re: [Neo4j] Very slow cypher query, how to optimize it ?

2016-03-15 Thread Michael Azerhad
Yes, but it would never be counted as a friend of friend. > Le 16 mars 2016 à 00:28, Michael Hunger a > écrit : > > your shortest-path doesn't imply that it's not the same person. > > Robert would also be counted as direct friend. > > On Wed, Mar 16, 2016

Re: [Neo4j] Very slow cypher query, how to optimize it ?

2016-03-15 Thread Michael Hunger
your shortest-path doesn't imply that it's not the same person. Robert would also be counted as direct friend. On Wed, Mar 16, 2016 at 12:25 AM, Michael Azerhad wrote: > Hi Michael, > > I think your query would result wrong results. > > Michael - *KNOWS* - Julia -

Re: [Neo4j] Very slow cypher query, how to optimize it ?

2016-03-15 Thread Michael Azerhad
shortestPath returns the right results. Without it, wrong results. -- 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+unsubscr...@googlegroups.com. For more

Re: [Neo4j] Very slow cypher query, how to optimize it ?

2016-03-15 Thread Michael Hunger
try this: MATCH (person:Person) OPTIONAL MATCH (person)-[:KNOWS]-(f1:Person)-[:KNOWS]-(f2:Person)-[:KNOWS]-( f3:Person) WITH person, count(distinct f1) as f1, count(distinct f2) as f2,count(distinct f3) as f3 RETURN person._firstName + " " + person._lastName, f1, f2, f3 alternatively MATCH

Re: [Neo4j] Very slow cypher query, how to optimize it ?

2016-03-15 Thread Michael Azerhad
Hi Michael, I think your query would result wrong results. Michael - *KNOWS* - Julia - *KNOWS* - Robert - *KNOWS* - Michael (same Michael as previous one) It would consider Robert as a friend's friend for Michael (Michael - Julia - Robert). However, it is his direct friend ... (Robert -

[Neo4j] Re: Index creation and query

2016-03-15 Thread Hugo Labra
Hi I created and index and updated the properties so their are added in the index :) Then now I am able to run queries and they are really fast :) But is this schema based index some kind of btree or lucene text index, so if I move to this new schema index instead of legacy lucene native,

[Neo4j] Re: Triple-Like 'facts' instead of Hyper-edges ?

2016-03-15 Thread John O'Gorman
Thanks for the input. Without knowing just how expensive my model is in terms of performance I believe I have some pretty solid reasons for the verbosity. (DNA, in spite of having only four base pairs is also verbose, so maybe I'm on to something. :D ) Part of the reason for the existence of