Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Understanding the roles of different operators in an execution plan can be an important step in making queries more efficient.
This page contains details and examples for each of the operators used by the Cypher planner.
For an overview of how the Cypher planner uses operators, see xref:planning-and-tuning/execution-plans.adoc#reading-execution-plans[ Understanding execution plans -> Reading execution plans].
For an overview of how the Cypher planner uses operators, see xref:planning-and-tuning/execution-plans.adoc#reading-execution-plans[ Understanding execution plans -> Reading execution plans].

The operators are grouped into categories based on the role they fulfill in executing a Cypher query:

Expand Down Expand Up @@ -1180,7 +1180,7 @@ Total database accesses: 1, total allocated memory: 184
======

[[query-plan-directed-all-relationships-scan]]
=== Directed All Relationships Scan
=== Directed All Relationships Scan

The `DirectedAllRelationshipsScan` operator fetches all relationships and their start and end nodes in the database.

Expand Down Expand Up @@ -2588,7 +2588,7 @@ Allows Cypher to use xref:indexes/search-performance-indexes/using-indexes.adoc#
.Query
[source, cypher]
----
PROFILE
PROFILE
WITH "Person" AS label
MATCH (people:$(label))
RETURN people.name
Expand Down Expand Up @@ -2634,7 +2634,7 @@ Allows Cypher to use xref:indexes/search-performance-indexes/using-indexes.adoc#
.Query
[source, cypher]
----
PROFILE
PROFILE
WITH "FRIENDS_WITH" AS relType
MATCH ()-[r:$(relType)]->()
RETURN count(r) as relCount
Expand Down Expand Up @@ -2680,7 +2680,7 @@ Allows Cypher to use xref:indexes/search-performance-indexes/using-indexes.adoc#
.Query
[source, cypher]
----
PROFILE
PROFILE
WITH "FRIENDS_WITH" AS relType
MATCH ()-[r:$(relType)]-()
RETURN count(r) as relCount
Expand Down Expand Up @@ -3379,23 +3379,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
----
Expand Down Expand Up @@ -6022,7 +6022,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
Expand All @@ -6036,25 +6036,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 |
+-----------------+----+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
+------------------+----+--------------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+----------------------+
| 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: 15, total allocated memory: 2232
Total database accesses: 1, total allocated memory: 584
----

======
Expand Down Expand Up @@ -7297,4 +7297,4 @@ Runtime version {neo4j-version}
Total database accesses: 0, total allocated memory: 64
----

======
======