Skip to content

Commit cb62af2

Browse files
Add documentation for new LockNodes operator (#1375)
Co-authored-by: Jens Pryce-Åklundh <[email protected]>
1 parent d1bf010 commit cb62af2

File tree

3 files changed

+104
-0
lines changed

3 files changed

+104
-0
lines changed

modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,26 @@ Cypher 25 was introduced in Neo4j 2025.06 and can only be used on Neo4j 2025.06+
2222
Features removed in Cypher 25 are still available on Neo4j 2025.06+ databases either by prepending a query with `CYPHER 5` or by having Cypher 5 as the default language for the database.
2323
For more information, see xref:queries/select-version.adoc[].
2424

25+
[[cypher-deprecations-additions-removals-2025.09]]
26+
== Neo4j 2025.09
27+
28+
=== New in Cypher 25
29+
30+
[cols="2", options="header"]
31+
|===
32+
| Feature
33+
| Details
34+
35+
a|
36+
label:functionality[]
37+
label:new[]
38+
39+
New operator: `LockNodes`
40+
41+
42+
a| Introduced xref::planning-and-tuning/operators/operators-detail.adoc#query-plan-lock-nodes[`LockNodes`] operator, sometimes used in conjunction with the `LockingMerge` operator to lock nodes.
43+
|===
44+
2545
[[cypher-deprecations-additions-removals-2025.08]]
2646
== Neo4j 2025.08
2747

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,13 @@ Tests for the presence of a pattern predicate in queries containing multiple pat
345345
|
346346
|
347347

348+
| xref::planning-and-tuning/operators/operators-detail.adoc#query-plan-lock-nodes[LockNodes]
349+
| Sometimes used in conjunction with the xref:planning-and-tuning/operators/operators-detail.adoc#query-plan-locking-merge[`LockingMerge`] operator to lock nodes.
350+
|
351+
|
352+
| label:new[Introduced in Neo4j 2025.09]
353+
354+
348355
| xref::planning-and-tuning/operators/operators-detail.adoc#query-plan-merge[Merge]
349356
| The `Merge` operator will either read or create nodes and/or relationships.
350357
|

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

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6059,6 +6059,83 @@ Total database accesses: 15, total allocated memory: 2232
60596059
60606060
======
60616061

6062+
[role=label--new-2025.09]
6063+
[[query-plan-lock-nodes]]
6064+
=== Lock Nodes
6065+
6066+
The `LockNodes` operator is sometimes used in conjunction with the xref:planning-and-tuning/operators/operators-detail.adoc#query-plan-locking-merge[`LockingMerge`] operator to lock nodes.
6067+
6068+
6069+
.LockNodes
6070+
======
6071+
6072+
.Query
6073+
[source, cypher]
6074+
----
6075+
PROFILE
6076+
MATCH (s:Person {name: 'me'})
6077+
MERGE (s)-[:FRIENDS_WITH]->(t:Person {size: size([()-->()|1])})
6078+
----
6079+
6080+
.Query Plan
6081+
[role="queryplan", subs="attributes+"]
6082+
----
6083+
Planner COST
6084+
6085+
Runtime PIPELINED
6086+
6087+
Runtime version DEV
6088+
6089+
Batch size 4
6090+
6091+
+----------------------------------------+----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
6092+
| Operator | Id | Details | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Pipeline |
6093+
+----------------------------------------+----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
6094+
| +ProduceResults | 0 | | 1 | 0 | 0 | 0 | 0/0 | 0.018 | |
6095+
| | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+ |
6096+
| +EmptyResult | 1 | | 1 | 0 | 0 | | 0/0 | 0.016 | In Pipeline 7 |
6097+
| | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
6098+
| +Apply | 2 | | 1 | 0 | 0 | | 0/0 | | |
6099+
| |\ +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
6100+
| | +ArgumentTracker | 19 | | 1 | 0 | 0 | 240 | 0/0 | 0.000 | |
6101+
| | | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+ |
6102+
| | +LockingMerge | 3 | CREATE (t:Person {size: COUNT { MATCH (`anon_2`)-[`anon_3`]->(`anon_4`) RETURN $`autoint_1` AS ` | 1 | 1 | 3 | 400 | 0/0 | 15.340 | In Pipeline 7 |
6103+
| | | | | anon_0` }}), (s)-[anon_1:FRIENDS_WITH]->(t), LOCK(s) | | | | | | | |
6104+
| | | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
6105+
| | +AntiConditionalApply | 18 | | | 0 | 0 | 384 | | 0.010 | In Pipeline 6 |
6106+
| | |\ +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
6107+
| | | +Filter | 17 | t.size = anon_5 AND t:Person | 0 | 0 | 4 | | | | |
6108+
| | | | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+ | | |
6109+
| | | +Apply | 16 | | 1 | 2 | 0 | | | | |
6110+
| | | |\ +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+ | | |
6111+
| | | | +RelationshipCountFromCountStore | 15 | count( ()-[]->() ) AS anon_5 | 1 | 2 | 2 | 608 | 0/0 | 0.113 | Fused in Pipeline 5 |
6112+
| | | | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
6113+
| | | +Expand(All) | 14 | (s)-[anon_1:FRIENDS_WITH]->(t) | 1 | 2 | 3 | | | | |
6114+
| | | | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+ | | |
6115+
| | | +LockNodes | 13 | s | 1 | 1 | 0 | | | | |
6116+
| | | | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+ | | |
6117+
| | | +Argument | 12 | s | 1 | 1 | 0 | 584 | 0/0 | 1.494 | Fused in Pipeline 4 |
6118+
| | | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
6119+
| | +Optional | 11 | s | 0 | 1 | 0 | 528 | 0/0 | 2.057 | In Pipeline 3 |
6120+
| | | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
6121+
| | +Filter | 5 | t.size = anon_5 AND t:Person | 0 | 0 | 4 | | | | |
6122+
| | | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+ | | |
6123+
| | +Apply | 6 | | 1 | 2 | 0 | | | | |
6124+
| | |\ +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+ | | |
6125+
| | | +RelationshipCountFromCountStore | 7 | count( ()-[]->() ) AS anon_5 | 1 | 2 | 2 | 528 | 0/0 | 4.220 | Fused in Pipeline 2 |
6126+
| | | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
6127+
| | +Expand(All) | 8 | (s)-[anon_1:FRIENDS_WITH]->(t) | 1 | 2 | 3 | | | | |
6128+
| | | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+ | | |
6129+
| | +Argument | 9 | s | 1 | 1 | 0 | 432 | 1/0 | 0.184 | Fused in Pipeline 1 |
6130+
| | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
6131+
| +NodeIndexSeek | 10 | RANGE INDEX s:Person(name) WHERE name = $autostring_0 | 1 | 1 | 2 | 376 | 0/1 | 9.263 | In Pipeline 0 |
6132+
+----------------------------------------+----+------------------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
6133+
6134+
Total database accesses: 23, total allocated memory: 3248
6135+
----
6136+
6137+
======
6138+
60626139

60636140

60646141
[[query-plan-foreach]]

0 commit comments

Comments
 (0)