diff --git a/modules/ROOT/pages/planning-and-tuning/operators/operators-detail.adoc b/modules/ROOT/pages/planning-and-tuning/operators/operators-detail.adoc index 2c6631919..c2756a4f5 100644 --- a/modules/ROOT/pages/planning-and-tuning/operators/operators-detail.adoc +++ b/modules/ROOT/pages/planning-and-tuning/operators/operators-detail.adoc @@ -6056,6 +6056,54 @@ Total database accesses: 15, total allocated memory: 2232 ====== +[[query-plan-merge-unique-node]] +=== Merge Unique Node + +//// +[source, cypher, role=test-setup] +---- +CREATE CONSTRAINT team_name IF NOT EXISTS FOR (t:Team) REQUIRE (t.name) IS UNIQUE +---- +//// + +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. + +.MergeUniqueNode +====== + +.Query +[source, cypher] +---- +PROFILE +MERGE (t:Team {name: 'Engineering'}) +---- + +.Query Plan +[role="queryplan", subs="attributes+"] +---- +Planner COST + +Runtime PIPELINED + +Runtime version {neo4j-version} + +Batch size 128 + ++------------------+----+---------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+--------------+ +| Operator | Id | Details | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Pipeline | Indexes Used | ++------------------+----+---------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+--------------+ +| +ProduceResults | 0 | | 1 | 0 | 0 | 0 | | | | | +| | +----+---------------------------------------------------+----------------+------+---------+----------------+ | | +--------------+ +| +EmptyResult | 1 | | 1 | 0 | 0 | | | | | | +| | +----+---------------------------------------------------+----------------+------+---------+----------------+ | | +--------------+ +| +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 | ++------------------+----+---------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+--------------+ + +Total database accesses: 2, total allocated memory: 312 +---- + +====== + [[query-plan-locking-merge]] === Locking Merge