From 5e17680c95364454f72acc6d0d8dc5ad039a5212 Mon Sep 17 00:00:00 2001 From: Stefano Ottolenghi Date: Mon, 3 Nov 2025 19:54:17 +0100 Subject: [PATCH 1/2] Update query profiles with new operator `MergeInto`. Sister of #1419 --- .../operators/operators-detail.adoc | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) 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 30e9edece..c6918f435 100644 --- a/modules/ROOT/pages/planning-and-tuning/operators/operators-detail.adoc +++ b/modules/ROOT/pages/planning-and-tuning/operators/operators-detail.adoc @@ -3403,23 +3403,23 @@ Runtime version {neo4j-version} Batch size 128 -+-----------------+----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+ -| Operator | Id | Details | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Pipeline | -+-----------------+----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+ -| +ProduceResults | 0 | | 1 | 0 | 0 | | | | | -| | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | | -| +EmptyResult | 1 | | 1 | 0 | 0 | | | | | -| | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | | -| +Apply | 2 | | 1 | 1 | 0 | | | | | -| |\ +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | | -| | +LockingMerge | 3 | CREATE (s)-[anon_0:FRIENDS_WITH]->(s), LOCK(s) | 1 | 1 | 1 | | | | | -| | | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | | -| | +Expand(Into) | 4 | (s)-[anon_0:FRIENDS_WITH]->(s) | 0 | 0 | 10 | 904 | | | | -| | | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | | -| | +Argument | 5 | s | 1 | 3 | 0 | 2280 | 2/0 | 0.460 | Fused in Pipeline 1 | -| | +----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+ -| +NodeIndexSeek | 6 | RANGE INDEX s:Person(name) WHERE name = $autostring_0 | 1 | 1 | 2 | 376 | 1/0 | 0.211 | In Pipeline 0 | -+-----------------+----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+ ++--------------------+----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+----------------------+ +| 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 | | | | | | +| | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ +| +Apply | 2 | | 1 | 0 | 0 | | | | | | +| |\ +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ +| | +ArgumentTracker | 6 | | 1 | 0 | 0 | 736 | | | | | +| | | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ +| | +MergeInto | 3 | MERGE (s)-[anon_0:FRIENDS_WITH]->(s) | 1 | 1 | 1 | | | | | | +| | | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ +| | +Argument | 4 | s | 1 | 1 | 0 | 2288 | 1/0 | 1.626 | Fused in Pipeline 1 | | +| | +----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+----------------------+ +| +NodeIndexSeek | 5 | RANGE INDEX s:Person(name) WHERE name = $autostring_0 | 1 | 1 | 2 | 376 | 1/0 | 0.300 | In Pipeline 0 | range_person_name: 1 | ++--------------------+----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+----------------------+ Total database accesses: 15, total allocated memory: 2232 ---- @@ -6050,7 +6050,7 @@ The `LockingMerge` operator is similar to the xref:planning-and-tuning/operators ---- PROFILE MATCH (s:Person {name: 'me'}) -MERGE (s)-[:FRIENDS_WITH]->(s) +MERGE (s)-[:FRIENDS_WITH]->(:Person {name: 'you'}) ---- .Query Plan @@ -6064,25 +6064,25 @@ Runtime version {neo4j-version} Batch size 128 -+-----------------+----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+ -| Operator | Id | Details | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Pipeline | -+-----------------+----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+ -| +ProduceResults | 0 | | 1 | 0 | 0 | | | | | -| | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | | -| +EmptyResult | 1 | | 1 | 0 | 0 | | | | | -| | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | | -| +Apply | 2 | | 1 | 1 | 0 | | | | | -| |\ +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | | -| | +LockingMerge | 3 | CREATE (s)-[anon_0:FRIENDS_WITH]->(s), LOCK(s) | 1 | 1 | 1 | | | | | -| | | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | | -| | +Expand(Into) | 4 | (s)-[anon_0:FRIENDS_WITH]->(s) | 0 | 0 | 10 | 904 | | | | -| | | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | | -| | +Argument | 5 | s | 1 | 3 | 0 | 2280 | 2/0 | 0.460 | Fused in Pipeline 1 | -| | +----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+ -| +NodeIndexSeek | 6 | RANGE INDEX s:Person(name) WHERE name = $autostring_0 | 1 | 1 | 2 | 376 | 1/0 | 0.211 | In Pipeline 0 | -+-----------------+----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+ - -Total database accesses: 15, total allocated memory: 2232 ++------------------+----+--------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+----------------------+ +| Operator | Id | Details | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Pipeline | Indexes Used | ++------------------+----+--------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+----------------------+ +| +ProduceResults | 0 | | 0 | 0 | 0 | | | | | | +| | +----+--------------------------------------------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ +| +EmptyResult | 1 | | 0 | 0 | 0 | | | | | | +| | +----+--------------------------------------------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ +| +Apply | 2 | | 0 | 0 | 0 | | | | | | +| |\ +----+--------------------------------------------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ +| | +LockingMerge | 3 | CREATE (anon_1:Person {name: $autostring_1}), (s)-[anon_0:FRIENDS_WITH]->(anon_1), LOCK(s) | 0 | 0 | 0 | | | | | | +| | | +----+--------------------------------------------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ +| | +Expand(Into) | 4 | (s)-[anon_0:FRIENDS_WITH]->(anon_1) | 0 | 0 | 0 | | | | | | +| | | +----+--------------------------------------------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ +| | +NodeIndexSeek | 5 | RANGE INDEX anon_1:Person(name) WHERE name = $autostring_1 | 0 | 0 | 0 | 128 | 0/0 | 0.000 | Fused in Pipeline 1 | | +| | +----+--------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+----------------------+ +| +NodeIndexSeek | 6 | RANGE INDEX s:Person(name) WHERE name = $autostring_0 | 0 | 0 | 1 | 376 | 1/0 | 0.186 | In Pipeline 0 | range_person_name: 1 | ++------------------+----+--------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+----------------------+ + +Total database accesses: 1, total allocated memory: 584 ---- ====== From cab1a8583120507506a2a364f533e97e4453da38 Mon Sep 17 00:00:00 2001 From: Stefano Ottolenghi Date: Tue, 11 Nov 2025 10:00:04 +0000 Subject: [PATCH 2/2] more --- .../operators/operators-detail.adoc | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) 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 c6918f435..5304c89ee 100644 --- a/modules/ROOT/pages/planning-and-tuning/operators/operators-detail.adoc +++ b/modules/ROOT/pages/planning-and-tuning/operators/operators-detail.adoc @@ -3403,23 +3403,21 @@ 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 | | | | | | -| | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ -| +Apply | 2 | | 1 | 0 | 0 | | | | | | -| |\ +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ -| | +ArgumentTracker | 6 | | 1 | 0 | 0 | 736 | | | | | -| | | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ -| | +MergeInto | 3 | MERGE (s)-[anon_0:FRIENDS_WITH]->(s) | 1 | 1 | 1 | | | | | | -| | | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ -| | +Argument | 4 | s | 1 | 1 | 0 | 2288 | 1/0 | 1.626 | Fused in Pipeline 1 | | -| | +----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+----------------------+ -| +NodeIndexSeek | 5 | RANGE INDEX s:Person(name) WHERE name = $autostring_0 | 1 | 1 | 2 | 376 | 1/0 | 0.300 | In Pipeline 0 | range_person_name: 1 | -+--------------------+----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+----------------------+ ++-----------------+----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+----------------------+ +| 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 | | | | | | +| | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ +| +Apply | 2 | | 1 | 1 | 0 | | | | | | +| |\ +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ +| | +MergeInto | 3 | MERGE (s)-[anon_0:FRIENDS_WITH]->(s) | 1 | 1 | 1 | | | | | | +| | | +----+-------------------------------------------------------+----------------+------+---------+----------------+ | | +----------------------+ +| | +Argument | 4 | s | 1 | 1 | 0 | 2288 | 1/0 | 0.368 | Fused in Pipeline 1 | | +| | +----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+----------------------+ +| +NodeIndexSeek | 5 | RANGE INDEX s:Person(name) WHERE name = $autostring_0 | 1 | 1 | 2 | 376 | 1/0 | 0.261 | In Pipeline 0 | range_person_name: 1 | ++-----------------+----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+----------------------+ Total database accesses: 15, total allocated memory: 2232 ----