neo4j-sh (?)$ create (a:Person {x:1}), (b:Person {x:2}), (c:Person {x:3});
+-------------------+
| No data returned. |
+-------------------+
Nodes created: 3
Properties set: 3
Labels added: 3
1079 ms
neo4j-sh (?)$ profile match (p:Person {x:2}) return p;
+--------------+
| p |
+--------------+
| Node[1]{x:2} |
+--------------+
1 row
Filter(pred="Property(p,x(0)) == Literal(2)", _rows=1, _db_hits=3)
NodeByLabel(label="Person", identifier="p", _rows=3, _db_hits=0)
neo4j-sh (?)$ create constraint on (p:Person) assert p.x is unique;
+-------------------+
| No data returned. |
+-------------------+
Constraints added: 1
50 ms
neo4j-sh (?)$ profile match (p:Person {x:2}) return p;
+--------------+
| p |
+--------------+
| Node[1]{x:2} |
+--------------+
1 row
SchemaIndex(identifier="p", _db_hits=0, _rows=1, label="Person", query="Literal(2)", property="x")
neo4j-sh (?)$ match (a:Person {x:1}), (b:Person {x:2}) create unique (a)-[:R]->(b), (a)-[:R]->(b);
+-------------------+
| No data returned. |
+-------------------+
Relationships created: 2
279 ms
neo4j-sh (?)$ match (a:Person {x:1})-[r]->() return r;
+---------+
| r |
+---------+
| :R[0]{} |
| :R[1]{} |
+---------+
2 rows
75 ms
neo4j-sh (?)$
It might be a bug that we're creating two relationships here with CREATE UNIQUE.