Skip to content

Commit 5c31c1c

Browse files
Add documentation for MergeUniqueNode (#1428)
Co-authored-by: Stefano Ottolenghi <[email protected]>
1 parent e8ef6d0 commit 5c31c1c

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

modules/ROOT/pages/planning-and-tuning/operators/operators-detail.adoc

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6056,6 +6056,54 @@ Total database accesses: 15, total allocated memory: 2232
60566056
60576057
======
60586058

6059+
[[query-plan-merge-unique-node]]
6060+
=== Merge Unique Node
6061+
6062+
////
6063+
[source, cypher, role=test-setup]
6064+
----
6065+
CREATE CONSTRAINT team_name IF NOT EXISTS FOR (t:Team) REQUIRE (t.name) IS UNIQUE
6066+
----
6067+
////
6068+
6069+
The `MergeUniqueNode` operator is similar to the xref:planning-and-tuning/operators/operators-detail.adoc#query-plan-merge[`Merge`] operator, but is used when there is a property uniqueness constraint on the property used in the `MERGE` statement.
6070+
6071+
.MergeUniqueNode
6072+
======
6073+
6074+
.Query
6075+
[source, cypher]
6076+
----
6077+
PROFILE
6078+
MERGE (t:Team {name: 'Engineering'})
6079+
----
6080+
6081+
.Query Plan
6082+
[role="queryplan", subs="attributes+"]
6083+
----
6084+
Planner COST
6085+
6086+
Runtime PIPELINED
6087+
6088+
Runtime version {neo4j-version}
6089+
6090+
Batch size 128
6091+
6092+
+------------------+----+---------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+--------------+
6093+
| Operator | Id | Details | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Pipeline | Indexes Used |
6094+
+------------------+----+---------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+--------------+
6095+
| +ProduceResults | 0 | | 1 | 0 | 0 | 0 | | | | |
6096+
| | +----+---------------------------------------------------+----------------+------+---------+----------------+ | | +--------------+
6097+
| +EmptyResult | 1 | | 1 | 0 | 0 | | | | | |
6098+
| | +----+---------------------------------------------------+----------------+------+---------+----------------+ | | +--------------+
6099+
| +MergeUniqueNode | 2 | UNIQUE t:Team(name) WHERE name = $autostring_0, | 1 | 1 | 2 | 248 | 1/0 | 2.922 | Fused in Pipeline 0 | team_name: 1 |
6100+
+------------------+----+---------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+--------------+
6101+
6102+
Total database accesses: 2, total allocated memory: 312
6103+
----
6104+
6105+
======
6106+
60596107

60606108
[[query-plan-locking-merge]]
60616109
=== Locking Merge

0 commit comments

Comments
 (0)