Re: [Neo4j] Questions about profiling and optimizing queries in Neo4j 2.2

2015-04-08 Thread bill
Seems to act the same with or without DISTINCT. I also tried to break up the query so that the OPTIONAL MATCH is more specific but it still ends up doing a NodeByLabelScan (better than an AllNodesScan) but it should be doing an OptionalFilter on the existing nodes. On Wednesday, April 8, 201

Re: [Neo4j] Questions about profiling and optimizing queries in Neo4j 2.2

2015-04-08 Thread Wes Freeman
I get it, sorry. Your confusion is justified--it probably shouldn't do that. It must have decided an AllNodeScan would be easier than scanning the shorter list of c nodes, which is definitely a bad plan. Does it act the same without DISTINCT? Wes On Wed, Apr 8, 2015 at 8:48 PM, wrote: > For q2,

Re: [Neo4j] Questions about profiling and optimizing queries in Neo4j 2.2

2015-04-08 Thread bill
I meant MATCH (c) (to use the previous result), not MATCH (c:contacts) which would have matched all contacts. On Wednesday, April 8, 2015 at 5:48:08 PM UTC-7, bi...@levelstory.com wrote: > > For q2, it's all part of the same query. I tried adding MATCH > (c:contacts) in front of the optional

Re: [Neo4j] Questions about profiling and optimizing queries in Neo4j 2.2

2015-04-08 Thread bill
For q2, it's all part of the same query. I tried adding MATCH (c:contacts) in front of the optional match but that didn't have any effect. This is the query that I'm executing: MATCH (c:contact {teamid: uc.teamid})-[:CONTACT]->(cr:role) WHERE (ur.name

Re: [Neo4j] Questions about profiling and optimizing queries in Neo4j 2.2

2015-04-08 Thread Wes Freeman
I'm guessing q3 is something like len(all nodes) * (len(PHONE) + len(ADDRESS) + len(TAG) + len(INVITE)) * len(all nodes) -- since you have no labels on the end nodes of the pattern, it's hard to estimate. Wes On Wed, Apr 8, 2015 at 8:29 PM, Wes Freeman wrote: > If the query you put in q2 is you

Re: [Neo4j] Questions about profiling and optimizing queries in Neo4j 2.2

2015-04-08 Thread Wes Freeman
If the query you put in q2 is your whole query, you should really start with a MATCH for any OPTIONAL MATCH, even if it's not a big pattern... like: MATCH (c:Contacts) OPTIONAL MATCH (c)-[:PHONE|ADDRESS|TAG|INVITE]->(x) RETURN c, COLLECT(DISTINCT x) AS xs, r -- You received this message because

[Neo4j] Re: What are best practices for using optional matches in Neo4j 2.2 Cypher queries?

2015-04-08 Thread bill
Here is another interesting case as I try things out. *This query takes 475ms and 66k db hits to execute:* PROFILE MATCH (:user { id:"foobar" })-[:CONTACT]->(uc:contact)-[:CONTACT]->(ur:role) WHERE HAS(ur.teamid) WITH uc, ur MATCH (c:contact {teamid: uc.teamid})-[:CONTACT]->(cr:role)

[Neo4j] What are best practices for using optional matches in Neo4j 2.2 Cypher queries?

2015-04-08 Thread bill
After some more testing, I don't think I understand how to use OPTIONAL MATCH statements correctly. I have a query to find a bunch of contacts that a user has access to within a team. PROFILE MATCH (:user { id:"foobar" })-[:CONTACT]->(uc:contact)-[:CONTACT]->(ur:role) WHERE HAS(ur.teamid

[Neo4j] Questions about profiling and optimizing queries in Neo4j 2.2

2015-04-08 Thread bill
I'm starting to profile my queries using the new 2.2 query profiler (which is great by the way!) and I had a couple of questions about what I am seeing. *Question 1* In a query like the following: MATCH (c:contact {teamid: uc.teamid})-[:CONTACT]->(cr:role) WHERE (ur.name IN ["Owners", "Adm

[Neo4j] Re: Neo4j browser 2.2 heisenbug?

2015-04-08 Thread ducky
Hi Oskar, I have just tried this but it doesn't have any effect. The strange things: 1) I get net:ERR_CONNECTION_RESET pretty much instantly. 2) I can visit the two files by putting their URLs in address bar. If it helps, I can share the IP address of the server privately with you. cheers

Re: [Neo4j] ORDER BY not defined in 2.2, works in 2.1

2015-04-08 Thread František Hartman
It does indeed. However, my queries are bit more complicated then this and changing the order makes it less readable imo (and different from what I am used to). On Wednesday, April 8, 2015 at 4:38:01 PM UTC+1, Javier de la Rosa wrote: > > Hi, > > It doesn't answer your question, but changing the

Re: [Neo4j] ORDER BY not defined in 2.2, works in 2.1

2015-04-08 Thread Javier de la Rosa
Hi, It doesn't answer your question, but changing the order seems to work MATCH (n:Crew)-[r:KNOWS*]-m WITH n,count(r) AS total ORDER BY total RETURN n On Wed, Apr 8, 2015 at 7:23 AM, František Hartman wrote: > Hi, > > I have tried to upgrade to 2.2 and got an error for some of our queries. >

[Neo4j] Import unique

2015-04-08 Thread Andreas Dernbauer
Helllo I am new to NEO4j and therfore I have a question regarding import. Is it possible to prevent NEO4j to load dublicates ? And if the answer is yes how can it be archived ? I could't find anything about this topic Thank you. -- You received this message because you are subscribed t

[Neo4j] Re: Neo4j browser 2.2 heisenbug?

2015-04-08 Thread Oskar Hane
Hey ducky, Thanks for the report. Somehow I get the feeling that this is due to aggressive browser caching even though you get the same result in incognito mode. Could you open the inspector in Chrome and check the "Disable cache" checkbox located at the top of the Network tab and then reload th

[Neo4j] ORDER BY not defined in 2.2, works in 2.1

2015-04-08 Thread František Hartman
Hi, I have tried to upgrade to 2.2 and got an error for some of our queries. All goes down to a following type of query: MATCH (n:Crew)-[r:KNOWS*]-m WITH n,count(r) AS total RETURN n ORDER BY total I get: Error: total not defined (line 1, column 72 (offset: 71)) In 2.1 it was working fine

[Neo4j] Neo4j browser 2.2 heisenbug?

2015-04-08 Thread ducky
Hi, I am trying to test deploying the new Neo4j (2.2.0) browser on a Digital Ocean droplet. I've done all the basic tuning and I am having some issues using the browser. When I visit http://:7474/browser, the browser loads up only partially. See attached image. When I open up the dev tools on

[Neo4j] 2.2.0 - LOAD CSV performance dramatically degrades after 25 millions relationships

2015-04-08 Thread Andrii Stesin
Hi neo4j gurus, let me describe the problem we hit while evaluating 2.2.0 enterprise ed. We are trying to import some sample data which is basically just pretty chaotic graph with about 50 millions nodes and about 450 millions relationships between them (unevenly distributed where 90% relations