Re: [Neo4j] Re: Slow node creation/commits with unique constraint in 2.0.0

2016-05-26 Thread Eric Fulton
I'm sorry, I'm not sure exactly what you mean by query scan.  I haven't 
changed any of the queries from before the addition of the uniqueness 
constraint.  I'm still doing the same "MERGE ..." query (like above, but 
with parameters, as you pointed out).  Do you mean that, or something else?

Thanks!
Eric

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [Neo4j] Re: Slow node creation/commits with unique constraint in 2.0.0

2016-05-26 Thread 'Michael Hunger' via Neo4j
Can you share the query plan from before and after the constraint?

Oh if you had an index on uid then you had the benefit of the "fast scan" but 
without the penalty of "asserting uniqueness across the index".

Michael

> Am 26.05.2016 um 18:25 schrieb Eric Fulton :
> 
> So before the constraint, I was still using merges because I really did want 
> something akin to uniqueness for these nodes.  We had an index on the "uid" 
> so maybe that helped with the full scan?
> Yes, I use parameters, not literal values.  
> 
> -- 
> 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 options, visit https://groups.google.com/d/optout.

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [Neo4j] Re: Slow node creation/commits with unique constraint in 2.0.0

2016-05-26 Thread Eric Fulton
So before the constraint, I was still using merges because I really did 
want something akin to uniqueness for these nodes.  We had an index on the 
"uid" so maybe that helped with the full scan?
Yes, I use parameters, not literal values.  

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [Neo4j] Re: Slow node creation/commits with unique constraint in 2.0.0

2016-05-25 Thread 'Michael Hunger' via Neo4j
Do you do one operation per transaction or multiple statements per transaction?

I presume you had CREATEs before you had the constraint, not MERGE's ? Because 
merges without constraints do a full scan on the label.

I also presume you use parameters, not literal values ?!

MERGE (n:Thing { uid : {uid} }) ON CREATE SET n.prop1  = {prop1}, n.prop2 = 
{prop2}

Did you add other indexes too?

> Am 26.05.2016 um 00:10 schrieb Eric Fulton :
> 
> 
> When I add data to the database, I use a merge something like this:
> MERGE (n:Thing { uid : }) ON CREATE SET n.prop1  = blah1, n.prop2 = 
> blah2 ...
> 
> Since I'm working in a multi-threaded environment, it's possible to have the 
> same node written twice and I've seen many instances where duplicate nodes 
> are created. SO
> I have an index on the uid.
> 
> CREATE CONSTRAINT ON (n:Thing) ASSERT n.uid IS UNIQUE
> 
> 
> Before creating the index, those merges were taking 1-50ms, now they take 
> 20-300ms.  Other operations like adding relationships seem to be taking quite 
> a bit longer too.
> 
> -- 
> 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 options, visit https://groups.google.com/d/optout.

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [Neo4j] Re: Slow node creation/commits with unique constraint in 2.0.0

2016-05-25 Thread Clark Richey
I would definitely expect there to be additional overhead now because before 
the write can happen an index lookup against uid now needs to happen. that has 
to take some time. I also wonder if you are getting some lock contention doing 
this multithreaded.

> On May 25, 2016, at 6:10 PM, Eric Fulton  wrote:
> 
> 
> When I add data to the database, I use a merge something like this:
> MERGE (n:Thing { uid : }) ON CREATE SET n.prop1  = blah1, n.prop2 = 
> blah2 ...
> 
> Since I'm working in a multi-threaded environment, it's possible to have the 
> same node written twice and I've seen many instances where duplicate nodes 
> are created. SO
> I have an index on the uid.
> 
> CREATE CONSTRAINT ON (n:Thing) ASSERT n.uid IS UNIQUE
> 
> 
> Before creating the index, those merges were taking 1-50ms, now they take 
> 20-300ms.  Other operations like adding relationships seem to be taking quite 
> a bit longer too.
> 
> -- 
> 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 options, visit https://groups.google.com/d/optout 
> .

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [Neo4j] Re: Slow node creation/commits with unique constraint in 2.0.0

2016-05-25 Thread Eric Fulton
This is version 2.3.3

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [Neo4j] Re: Slow node creation/commits with unique constraint in 2.0.0

2016-05-25 Thread Eric Fulton

When I add data to the database, I use a merge something like this:
MERGE (n:Thing { uid : }) ON CREATE SET n.prop1  = blah1, n.prop2 
= blah2 ...

Since I'm working in a multi-threaded environment, it's possible to have 
the same node written twice and I've seen many instances where duplicate 
nodes are created. SO
I have an index on the uid.

CREATE CONSTRAINT ON (n:Thing) ASSERT n.uid IS UNIQUE


Before creating the index, those merges were taking 1-50ms, now they take 
20-300ms.  Other operations like adding relationships seem to be taking 
quite a bit longer too.

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [Neo4j] Re: Slow node creation/commits with unique constraint in 2.0.0

2016-05-25 Thread 'Michael Hunger' via Neo4j
Can give us more details?

Michael

> Am 25.05.2016 um 23:50 schrieb Eric Fulton :
> 
> I'm still seeing 10x performance hit from a uniqueness constraint being 
> added.  Is this on the roadmap to be addressed?
> 
> -- 
> 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 options, visit https://groups.google.com/d/optout.

-- 
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 options, visit https://groups.google.com/d/optout.