cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Why does my CREATE CONSTRAINT take so long to complete

When creating a constraint, for example

CREATE CONSTRAINT ON (n:ZipCode) ASSERT n.name IS UNIQUE; 

this will require a lock on all nodes with the label the constraint is being created for, in this case ZipCode

If you have another transaction which was opened prior to the CREATE CONSTRAINT Cypher statement and it has a lock on the same Node label, for example

Begin
create (n:ZipCode {name:'94401'}) return n;

then the CREATE CONSTRAINT will not progress until the open transaction is comitted/rolled back.

0 REPLIES 0