Execution plan operators in detail

All executin plan operators are listed here, grouped by the similarity of their characteristics.

Certain operators are only used by a subset of the runtimes that Cypher® can choose from. If that is the case, the example queries will be prefixed with an option to choose one of these runtimes.

All Nodes Scan

The AllNodesScan operator reads all nodes from the node store. The variable that will contain the nodes is seen in the arguments. Any query using this operator is likely to encounter performance problems on a non-trivial database.

Example 1. AllNodesScan
Query
MATCH (n)
RETURN n
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+---------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+---------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | n       |             35 |   35 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +---------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan   | n       |             35 |   35 |      36 |            112 |                    3/0 |     0.598 | Fused in Pipeline 0 |
+-----------------+---------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 36, total allocated memory: 176

Directed Relationship Index Scan

The DirectedRelationshipIndexScan operator examines all values stored in an index, returning all relationships and their start and end nodes with a particular relationship type and a specified property.

Example 2. DirectedRelationshipIndexScan
Query
MATCH ()-[r: WORKS_IN]->()
WHERE r.title IS NOT NULL
RETURN r
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+--------------------------------+----------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                       | Details                                                                    | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+--------------------------------+----------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                | r                                                                          |             15 |   15 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                              +----------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +DirectedRelationshipIndexScan | BTREE INDEX (anon_0)-[r:WORKS_IN(title)]->(anon_1) WHERE title IS NOT NULL |             15 |   15 |      31 |            112 |                    3/1 |     0.874 | Fused in Pipeline 0 |
+--------------------------------+----------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 31, total allocated memory: 176

Undirected Relationship Index Scan

The UndirectedRelationshipIndexScan operator examines all values stored in an index, returning all relationships and their start and end nodes with a particular relationship type and a specified property.

Example 3. UndirectedRelationshipIndexScan
Query
MATCH ()-[r: WORKS_IN]-()
WHERE r.title IS NOT NULL
RETURN r
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+----------------------------------+---------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                         | Details                                                                   | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+----------------------------------+---------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                  | r                                                                         |             30 |   30 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                                +---------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +UndirectedRelationshipIndexScan | BTREE INDEX (anon_0)-[r:WORKS_IN(title)]-(anon_1) WHERE title IS NOT NULL |             30 |   30 |      31 |            112 |                    3/1 |     1.005 | Fused in Pipeline 0 |
+----------------------------------+---------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 31, total allocated memory: 176

Directed Relationship Index Seek

The DirectedRelationshipIndexSeek operator finds relationships and their start and end nodes using an index seek. The relationship variable and the index used are shown in the arguments of the operator.

Example 4. DirectedRelationshipIndexSeek
Query
MATCH (candidate)-[r:WORKS_IN]->()
WHERE r.title = 'chief architect'
RETURN candidate
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+--------------------------------+-----------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                       | Details                                                                           | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+--------------------------------+-----------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                | candidate                                                                         |              2 |    1 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                              +-----------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +DirectedRelationshipIndexSeek | BTREE INDEX (candidate)-[r:WORKS_IN(title)]->(anon_0) WHERE title = $autostring_0 |              2 |    1 |       3 |            112 |                    3/1 |     0.416 | Fused in Pipeline 0 |
+--------------------------------+-----------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 3, total allocated memory: 176

Undirected Relationship Index Seek

The UndirectedRelationshipIndexSeek operator finds relationships and their start and end nodes using an index seek. The relationship variable and the index used are shown in the arguments of the operator.

Example 5. UndirectedRelationshipIndexSeek
Query
MATCH (candidate)-[r:WORKS_IN]-()
WHERE r.title = 'chief architect'
RETURN candidate
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+----------------------------------+----------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                         | Details                                                                          | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+----------------------------------+----------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                  | candidate                                                                        |              4 |    2 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                                +----------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +UndirectedRelationshipIndexSeek | BTREE INDEX (candidate)-[r:WORKS_IN(title)]-(anon_0) WHERE title = $autostring_0 |              4 |    2 |       3 |            112 |                    3/1 |     0.472 | Fused in Pipeline 0 |
+----------------------------------+----------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 3, total allocated memory: 176

Directed Relationship By Id Seek

The DirectedRelationshipByIdSeek operator reads one or more relationships by id from the relationship store, and produces both the relationship and the nodes on either side.

Example 6. DirectedRelationshipByIdSeek
Query
MATCH (n1)-[r]->()
WHERE id(r) = 0
RETURN r, n1
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-------------------------------+---------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                      | Details                                     | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-------------------------------+---------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults               | r, n1                                       |              1 |    1 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                             +---------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +DirectedRelationshipByIdSeek | (n1)-[r]->(anon_0) WHERE id(r) = $autoint_0 |              1 |    1 |       1 |            112 |                    4/0 |     0.306 | Fused in Pipeline 0 |
+-------------------------------+---------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 1, total allocated memory: 176

Undirected Relationship By Id Seek

The UndirectedRelationshipByIdSeek operator reads one or more relationships by id from the relationship store. As the direction is unspecified, two rows are produced for each relationship as a result of alternating the combination of the start and end node.

Example 7. UndirectedRelationshipByIdSeek
Query
MATCH (n1)-[r]-()
WHERE id(r) = 1
RETURN r, n1
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+---------------------------------+--------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                        | Details                                    | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+---------------------------------+--------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                 | r, n1                                      |              2 |    2 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                               +--------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +UndirectedRelationshipByIdSeek | (n1)-[r]-(anon_0) WHERE id(r) = $autoint_0 |              2 |    2 |       1 |            112 |                    4/0 |     0.890 | Fused in Pipeline 0 |
+---------------------------------+--------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 1, total allocated memory: 176

Directed Relationship Index Contains Scan

The DirectedRelationshipIndexContainsScan operator examines all values stored in an index, searching for entries containing a specific string; for example, in queries including CONTAINS. Although this is slower than an index seek (since all entries need to be examined), it is still faster than the indirection resulting from a type scan using DirectedRelationshipTypeScan, and a property store filter.

Example 8. DirectedRelationshipIndexContainsScan
Query
MATCH ()-[r: WORKS_IN]->()
WHERE r.title CONTAINS 'senior'
RETURN r
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+----------------------------------------+---------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                               | Details                                                                               | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+----------------------------------------+---------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                        | r                                                                                     |              0 |    4 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                                      +---------------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +DirectedRelationshipIndexContainsScan | BTREE INDEX (anon_0)-[r:WORKS_IN(title)]->(anon_1) WHERE title CONTAINS $autostring_0 |              0 |    4 |       9 |            112 |                    3/1 |     0.490 | Fused in Pipeline 0 |
+----------------------------------------+---------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 9, total allocated memory: 176

Undirected Relationship Index Contains Scan

The UndirectedRelationshipIndexContainsScan operator examines all values stored in an index, searching for entries containing a specific string; for example, in queries including CONTAINS. Although this is slower than an index seek (since all entries need to be examined), it is still faster than the indirection resulting from a type scan using DirectedRelationshipTypeScan, and a property store filter.

Example 9. UndirectedRelationshipIndexContainsScan
Query
MATCH ()-[r: WORKS_IN]-()
WHERE r.title CONTAINS 'senior'
RETURN r
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+------------------------------------------+--------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                                 | Details                                                                              | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+------------------------------------------+--------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                          | r                                                                                    |              0 |    8 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                                        +--------------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +UndirectedRelationshipIndexContainsScan | BTREE INDEX (anon_0)-[r:WORKS_IN(title)]-(anon_1) WHERE title CONTAINS $autostring_0 |              0 |    8 |       9 |            112 |                    3/1 |     0.700 | Fused in Pipeline 0 |
+------------------------------------------+--------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 9, total allocated memory: 176

Directed Relationship Index Ends With Scan

The DirectedRelationshipIndexEndsWithScan operator examines all values stored in an index, searching for entries ending in a specific string; for example, in queries containing ENDS WITH. Although this is slower than an index seek (since all entries need to be examined), it is still faster than the indirection resulting from a label scan using NodeByLabelScan, and a property store filter.

Example 10. DirectedRelationshipIndexEndsWithScan
Query
MATCH ()-[r: WORKS_IN]->()
WHERE r.title ENDS WITH 'developer'
RETURN r
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+----------------------------------------+----------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                               | Details                                                                                | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+----------------------------------------+----------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                        | r                                                                                      |              0 |    8 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                                      +----------------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +DirectedRelationshipIndexEndsWithScan | BTREE INDEX (anon_0)-[r:WORKS_IN(title)]->(anon_1) WHERE title ENDS WITH $autostring_0 |              0 |    8 |      17 |            112 |                    3/1 |     1.158 | Fused in Pipeline 0 |
+----------------------------------------+----------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 17, total allocated memory: 176

Undirected Relationship Index Ends With Scan

The UndirectedRelationshipIndexEndsWithScan operator examines all values stored in an index, searching for entries ending in a specific string; for example, in queries containing ENDS WITH. Although this is slower than an index seek (since all entries need to be examined), it is still faster than the indirection resulting from a label scan using NodeByLabelScan, and a property store filter.

Example 11. UndirectedRelationshipIndexEndsWithScan
Query
MATCH ()-[r: WORKS_IN]-()
WHERE r.title ENDS WITH 'developer'
RETURN r
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+------------------------------------------+---------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                                 | Details                                                                               | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+------------------------------------------+---------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                          | r                                                                                     |              0 |   16 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                                        +---------------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +UndirectedRelationshipIndexEndsWithScan | BTREE INDEX (anon_0)-[r:WORKS_IN(title)]-(anon_1) WHERE title ENDS WITH $autostring_0 |              0 |   16 |      17 |            112 |                    3/1 |     0.655 | Fused in Pipeline 0 |
+------------------------------------------+---------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 17, total allocated memory: 176

Directed Relationship Index Seek By Range

The DirectedRelationshipIndexSeekByRange operator finds relationships and their start and end nodes using an index seek where the value of the property matches a given prefix string. DirectedRelationshipIndexSeekByRange can be used for STARTS WITH and comparison operators such as <, >, <= and >=.

Example 12. DirectedRelationshipIndexSeekByRange
Query
MATCH (candidate: Person)-[r:WORKS_IN]->(location)
WHERE r.duration > 100
RETURN candidate
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+---------------------------------------+----------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                              | Details                                                                                | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+---------------------------------------+----------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                       | candidate                                                                              |              4 |   15 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                                     +----------------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter                               | candidate:Person                                                                       |              4 |   15 |      15 |                |                        |           | Fused in Pipeline 0 |
| |                                     +----------------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +DirectedRelationshipIndexSeekByRange | BTREE INDEX (candidate)-[r:WORKS_IN(duration)]->(location) WHERE duration > $autoint_0 |              4 |   15 |      31 |            112 |                    4/1 |     0.495 | Fused in Pipeline 0 |
+---------------------------------------+----------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 46, total allocated memory: 176

Undirected Relationship Index Seek By Range

The UndirectedRelationshipIndexSeekByRange operator finds relationships and their start and end nodes using an index seek where the value of the property matches a given prefix string. UndirectedRelationshipIndexSeekByRange can be used for STARTS WITH and comparison operators such as <, >, <= and >=.

Example 13. UndirectedRelationshipIndexSeekByRange
Query
MATCH (candidate: Person)-[r:WORKS_IN]-(location)
WHERE r.duration > 100
RETURN candidate
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------------------------------+---------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                                | Details                                                                               | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------------------------------+---------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                         | candidate                                                                             |              4 |   15 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                                       +---------------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter                                 | candidate:Person                                                                      |              4 |   15 |      30 |                |                        |           | Fused in Pipeline 0 |
| |                                       +---------------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +UndirectedRelationshipIndexSeekByRange | BTREE INDEX (candidate)-[r:WORKS_IN(duration)]-(location) WHERE duration > $autoint_0 |              8 |   30 |      31 |            112 |                    4/1 |     0.728 | Fused in Pipeline 0 |
+-----------------------------------------+---------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 61, total allocated memory: 176

Directed Relationship Type Scan

The DirectedRelationshipTypeScan operator fetches all relationships and their start and end nodes with a specific type from the relationship type index.

Example 14. DirectedRelationshipTypeScan
Query
MATCH ()-[r: FRIENDS_WITH]->()
RETURN r
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-------------------------------+-------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                      | Details                             | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-------------------------------+-------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults               | r                                   |              2 |    2 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                             +-------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +DirectedRelationshipTypeScan | (anon_0)-[r:FRIENDS_WITH]->(anon_1) |              2 |    2 |       5 |            112 |                    2/1 |     0.470 | Fused in Pipeline 0 |
+-------------------------------+-------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 5, total allocated memory: 176

Undirected Relationship Type Scan

The UndirectedRelationshipTypeScan operator fetches all relationships and their start and end nodes with a specific type from the relationship type index.

Query
MATCH ()-[r: FRIENDS_WITH]-()
RETURN r
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+---------------------------------+------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                        | Details                            | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+---------------------------------+------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                 | r                                  |              4 |    4 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                               +------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +UndirectedRelationshipTypeScan | (anon_0)-[r:FRIENDS_WITH]-(anon_1) |              4 |    4 |       5 |            112 |                    2/1 |     0.821 | Fused in Pipeline 0 |
+---------------------------------+------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 5, total allocated memory: 176

Node By Id Seek

The NodeByIdSeek operator reads one or more nodes by id from the node store.

Example 15. NodeByIdSeek
Query
MATCH (n)
WHERE id(n) = 0
RETURN n
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+----------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details                    | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+----------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | n                          |              1 |    1 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeByIdSeek   | n WHERE id(n) = $autoint_0 |              1 |    1 |       1 |            112 |                    3/0 |     0.252 | Fused in Pipeline 0 |
+-----------------+----------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 1, total allocated memory: 176

Node By Label Scan

The NodeByLabelScan operator fetches all nodes with a specific label from the node label index.

Example 16. NodeByLabelScan
Query
MATCH (person:Person)
RETURN person
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+------------------+---------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator         | Details       | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+------------------+---------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults  | person        |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                +---------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeByLabelScan | person:Person |             14 |   14 |      15 |            112 |                    2/1 |     0.446 | Fused in Pipeline 0 |
+------------------+---------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 15, total allocated memory: 176

Node Index Seek

The NodeIndexSeek operator finds nodes using an index seek. The node variable and the index used are shown in the arguments of the operator. If the index is a unique index, the operator is instead called NodeUniqueIndexSeek.

Example 17. NodeIndexSeek
Query
MATCH (location:Location {name: 'Malmo'})
RETURN location
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+----------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details                                                        | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+----------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | location                                                       |              1 |    1 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeIndexSeek  | BTREE INDEX location:Location(name) WHERE name = $autostring_0 |              1 |    1 |       2 |            112 |                    2/1 |     0.422 | Fused in Pipeline 0 |
+-----------------+----------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 2, total allocated memory: 176

Node Unique Index Seek

The NodeUniqueIndexSeek operator finds nodes using an index seek within a unique index. The node variable and the index used are shown in the arguments of the operator. If the index is not unique, the operator is instead called NodeIndexSeek. If the index seek is used to solve a MERGE clause, it will also be marked with (Locking). This makes it clear that any nodes returned from the index will be locked in order to prevent concurrent conflicting updates.

Example 18. NodeUniqueIndexSeek
Query
MATCH (t:Team {name: 'Malmo'})
RETURN t
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+----------------------+------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator             | Details                                        | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+----------------------+------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults      | t                                              |              1 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                    +------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeUniqueIndexSeek | UNIQUE t:Team(name) WHERE name = $autostring_0 |              1 |    0 |       1 |            112 |                    0/1 |     0.414 | Fused in Pipeline 0 |
+----------------------+------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 1, total allocated memory: 176

Multi Node Index Seek

The MultiNodeIndexSeek operator finds nodes using multiple index seeks. It supports using multiple distinct indexes for different nodes in the query. The node variables and the indexes used are shown in the arguments of the operator.

The operator yields a cartesian product of all index seeks. For example, if the operator does two seeks and the first seek finds the nodes a1, a2 and the second b1, b2, b3, the MultiNodeIndexSeek will yield the rows (a1, b1), (a1, b2), (a1, b3), (a2, b1), (a2, b2), (a2, b3).

Example 19. MultiNodeIndexSeek
Query
CYPHER runtime=pipelined
MATCH
  (location:Location {name: 'Malmo'}),
  (person:Person {name: 'Bob'})
RETURN location, person
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+---------------------+-----------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator            | Details                                                         | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+---------------------+-----------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults     | location, person                                                |              1 |    1 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                   +-----------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +MultiNodeIndexSeek | BTREE INDEX location:Location(name) WHERE name = $autostring_0, |              1 |    0 |       0 |            112 |                    2/2 |     1.216 | Fused in Pipeline 0 |
|                     | BTREE INDEX person:Person(name) WHERE name = $autostring_1      |                |      |         |                |                        |           |                     |
+---------------------+-----------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 0, total allocated memory: 176

Asserting Multi Node Index Seek

The AssertingMultiNodeIndexSeek operator is used to ensure that no unique constraints are violated. The example looks for the presence of a team with the supplied name and id, and if one does not exist, it will be created. Owing to the existence of two unique constraints on :Team(name) and :Team(id), any node that would be found by the UniqueIndexSeek must be the very same node, or the constraints would be violated.

Example 20. AssertingMultiNodeIndexSeek
Query
MERGE (t:Team {name: 'Engineering', id: 42})
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+------------------------------+-----------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                     | Details                                                                                 | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+------------------------------+-----------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults              |                                                                                         |              1 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                            +-----------------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +EmptyResult                 |                                                                                         |              1 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                            +-----------------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Merge                       | CREATE (t:Team {name: $autostring_0, id: $autoint_1})                                   |              1 |    1 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                            +-----------------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AssertingMultiNodeIndexSeek | UNIQUE t:Team(name) WHERE name = $autostring_0, UNIQUE t:Team(id) WHERE id = $autoint_1 |              0 |    2 |       4 |            112 |                    0/2 |     2.260 | Fused in Pipeline 0 |
+------------------------------+-----------------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 4, total allocated memory: 176

Node Index Seek By Range

The NodeIndexSeekByRange operator finds nodes using an index seek where the value of the property matches a given prefix string. NodeIndexSeekByRange can be used for STARTS WITH and comparison operators such as <, >, <= and >=. If the index is a unique index, the operator is instead called NodeUniqueIndexSeekByRange.

Example 21. NodeIndexSeekByRange
Query
MATCH (l:Location)
WHERE l.name STARTS WITH 'Lon'
RETURN l
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------------+-------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator              | Details                                                           | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------------+-------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults       | l                                                                 |              2 |    1 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                     +-------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeIndexSeekByRange | BTREE INDEX l:Location(name) WHERE name STARTS WITH $autostring_0 |              2 |    1 |       2 |            112 |                    3/0 |     1.095 | Fused in Pipeline 0 |
+-----------------------+-------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 2, total allocated memory: 176

Node Unique Index Seek By Range

The NodeUniqueIndexSeekByRange operator finds nodes using an index seek within a unique index, where the value of the property matches a given prefix string. NodeUniqueIndexSeekByRange is used by STARTS WITH and comparison operators such as <, >, <=, and >=. If the index is not unique, the operator is instead called NodeIndexSeekByRange.

Example 22. NodeUniqueIndexSeekByRange
Query
MATCH (t:Team)
WHERE t.name STARTS WITH 'Ma'
RETURN t
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------------------+----------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                    | Details                                                  | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------------------+----------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults             | t                                                        |              2 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                           +----------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeUniqueIndexSeekByRange | UNIQUE t:Team(name) WHERE name STARTS WITH $autostring_0 |              2 |    0 |       1 |            112 |                    1/0 |     0.781 | Fused in Pipeline 0 |
+-----------------------------+----------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 1, total allocated memory: 176

Node Index Contains Scan

The NodeIndexContainsScan operator examines all values stored in an index, searching for entries containing a specific string; for example, in queries including CONTAINS. Although this is slower than an index seek (since all entries need to be examined), it is still faster than the indirection resulting from a label scan using NodeByLabelScan, and a property store filter.

Example 23. NodeIndexContainsScan
Query
MATCH (l:Location)
WHERE l.name CONTAINS 'al'
RETURN l
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+------------------------+----------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator               | Details                                                        | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+------------------------+----------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults        | l                                                              |              0 |    2 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                      +----------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeIndexContainsScan | BTREE INDEX l:Location(name) WHERE name CONTAINS $autostring_0 |              0 |    2 |       3 |            112 |                    2/1 |     0.470 | Fused in Pipeline 0 |
+------------------------+----------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 3, total allocated memory: 176

Node Index Ends With Scan

The NodeIndexEndsWithScan operator examines all values stored in an index, searching for entries ending in a specific string; for example, in queries containing ENDS WITH. Although this is slower than an index seek (since all entries need to be examined), it is still faster than the indirection resulting from a label scan using NodeByLabelScan, and a property store filter.

Example 24. NodeIndexEndsWithScan
Query
MATCH (l:Location)
WHERE l.name ENDS WITH 'al'
RETURN l
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+------------------------+-----------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator               | Details                                                         | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+------------------------+-----------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults        | l                                                               |              0 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                      +-----------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeIndexEndsWithScan | BTREE INDEX l:Location(name) WHERE name ENDS WITH $autostring_0 |              0 |    0 |       1 |            112 |                    0/1 |     0.270 | Fused in Pipeline 0 |
+------------------------+-----------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 1, total allocated memory: 176

Node Index Scan

The NodeIndexScan operator examines all values stored in an index, returning all nodes with a particular label and a specified property.

Example 25. NodeIndexScan
Query
MATCH (l:Location)
WHERE l.name IS NOT NULL
RETURN l
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+-----------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details                                             | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+-----------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | l                                                   |             10 |   10 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +-----------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeIndexScan  | BTREE INDEX l:Location(name) WHERE name IS NOT NULL |             10 |   10 |      11 |            112 |                    2/1 |     0.486 | Fused in Pipeline 0 |
+-----------------+-----------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 11, total allocated memory: 176

Apply

All the different Apply operators (listed below) share the same basic functionality: they perform a nested loop by taking a single row from the left-hand side, and using the Argument operator on the right-hand side, execute the operator tree on the right-hand side. The versions of the Apply operators differ in how the results are managed. The Apply operator (i.e. the standard version) takes the row produced by the right-hand side — which at this point contains data from both the left-hand and right-hand sides — and yields it.

Example 26. Apply
Query
MATCH (p:Person {name: 'me'})
MATCH (q:Person {name: p.secondName})
RETURN p, q
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+------------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator         | Details                                               | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+------------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults  | p, q                                                  |              1 |    0 |       0 |                |                        |           | Fused in Pipeline 1 |
| |                +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Apply           |                                                       |              1 |    0 |       0 |                |                        |           |                     |
| |\               +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +NodeIndexSeek | BTREE INDEX q:Person(name) WHERE name = p.secondName  |              1 |    0 |       0 |           2152 |                    0/0 |     0.173 | Fused in Pipeline 1 |
| |                +-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +NodeIndexSeek   | BTREE INDEX p:Person(name) WHERE name = $autostring_0 |              1 |    1 |       2 |            112 |                    0/1 |     0.227 | In Pipeline 0       |
+------------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 2, total allocated memory: 2216

Semi Apply

The SemiApply operator tests for the presence of a pattern predicate, and is a variation of the Apply operator. If the right-hand side operator yields at least one row, the row from the left-hand side operator is yielded by the SemiApply operator. This makes SemiApply a filtering operator, used mostly for pattern predicates in queries.

Example 27. SemiApply
Query
CYPHER runtime=slotted
MATCH (p:Person)
WHERE (p)-[:FRIENDS_WITH]->(:Person)
RETURN p.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+-----------------+-------------------------------------+----------------+------+---------+------------------------+
| Operator        | Details                             | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+-----------------+-------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults | `p.name`                            |             11 |    2 |       0 |                    0/0 |
| |               +-------------------------------------+----------------+------+---------+------------------------+
| +Projection     | p.name AS `p.name`                  |             11 |    2 |       2 |                    1/0 |
| |               +-------------------------------------+----------------+------+---------+------------------------+
| +SemiApply      |                                     |             11 |    2 |       0 |                    0/0 |
| |\              +-------------------------------------+----------------+------+---------+------------------------+
| | +Filter       | anon_3:Person                       |              2 |    0 |       2 |                    0/0 |
| | |             +-------------------------------------+----------------+------+---------+------------------------+
| | +Expand(All)  | (p)-[anon_2:FRIENDS_WITH]->(anon_3) |              2 |    2 |      33 |                   28/0 |
| | |             +-------------------------------------+----------------+------+---------+------------------------+
| | +Argument     | p                                   |             14 |   14 |       0 |                    0/0 |
| |               +-------------------------------------+----------------+------+---------+------------------------+
| +Filter         | p:Person                            |             14 |   14 |      35 |                    1/0 |
| |               +-------------------------------------+----------------+------+---------+------------------------+
| +AllNodesScan   | p                                   |             35 |   35 |      36 |                    1/0 |
+-----------------+-------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 108, total allocated memory: 64

Anti Semi Apply

The AntiSemiApply operator tests for the absence of a pattern, and is a variation of the Apply operator. If the right-hand side operator yields no rows, the row from the left-hand side operator is yielded by the AntiSemiApply operator. This makes AntiSemiApply a filtering operator, used for pattern predicates in queries.

Example 28. AntiSemiApply
Query
CYPHER runtime=slotted
MATCH
  (me:Person {name: 'me'}),
  (other:Person)
WHERE NOT (me)-[:FRIENDS_WITH]->(other)
RETURN other.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+-------------------+--------------------------------------------------------+----------------+------+---------+----------------+------------------------+
| Operator          | Details                                                | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses |
+-------------------+--------------------------------------------------------+----------------+------+---------+----------------+------------------------+
| +ProduceResults   | `other.name`                                           |              4 |   13 |       0 |                |                    0/0 |
| |                 +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+
| +Projection       | other.name AS `other.name`                             |              4 |   13 |      13 |                |                    1/0 |
| |                 +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+
| +AntiSemiApply    |                                                        |              4 |   13 |       0 |                |                    0/0 |
| |\                +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+
| | +Expand(Into)   | (me)-[anon_2:FRIENDS_WITH]->(other)                    |              0 |    0 |      55 |            888 |                   28/0 |
| | |               +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+
| | +Argument       | me, other                                              |             14 |   14 |       0 |                |                    0/0 |
| |                 +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+
| +CartesianProduct |                                                        |             14 |   14 |       0 |                |                    0/0 |
| |\                +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+
| | +Filter         | other:Person                                           |             14 |   14 |      35 |                |                    1/0 |
| | |               +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+
| | +AllNodesScan   | other                                                  |             35 |   35 |      36 |                |                    1/0 |
| |                 +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+
| +NodeIndexSeek    | BTREE INDEX me:Person(name) WHERE name = $autostring_0 |              1 |    1 |       2 |                |                    0/1 |
+-------------------+--------------------------------------------------------+----------------+------+---------+----------------+------------------------+

Total database accesses: 141, total allocated memory: 968

Anti

The Anti operator tests for the absence of a pattern. If there are incoming rows, the Anti operator will yield no rows. If there are no incoming rows, the Anti operator will yield a single row.

Example 29. Anti
Query
CYPHER runtime=pipelined
MATCH
  (me:Person {name: 'me'}),
  (other:Person)
WHERE NOT (me)-[:FRIENDS_WITH]->(other)
RETURN other.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-------------------+--------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator          | Details                                                | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-------------------+--------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults   | `other.name`                                           |              4 |   13 |       0 |                |                    0/0 |     0.086 | In Pipeline 4       |
| |                 +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Projection       | other.name AS `other.name`                             |              4 |   13 |      26 |                |                    2/0 |     0.069 | In Pipeline 4       |
| |                 +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Apply            |                                                        |              4 |   13 |       0 |                |                    0/0 |           |                     |
| |\                +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| | +Anti           |                                                        |             14 |   13 |       0 |           1256 |                    0/0 |     0.070 | In Pipeline 4       |
| | |               +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| | +Limit          | 1                                                      |             14 |    1 |       0 |            752 |                        |           | Fused in Pipeline 3 |
| | |               +--------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Expand(Into)   | (me)-[anon_2:FRIENDS_WITH]->(other)                    |              0 |    1 |      55 |           2848 |                        |           | Fused in Pipeline 3 |
| | |               +--------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Argument       | me, other                                              |             14 |   14 |       0 |           3184 |                    1/0 |     1.158 | Fused in Pipeline 3 |
| |                 +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +CartesianProduct |                                                        |             14 |   14 |       0 |           3664 |                        |     0.107 | In Pipeline 2       |
| |\                +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| | +Filter         | other:Person                                           |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 1 |
| | |               +--------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +AllNodesScan   | other                                                  |             35 |   35 |      36 |            128 |                    1/0 |     0.158 | Fused in Pipeline 1 |
| |                 +--------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +NodeIndexSeek    | BTREE INDEX me:Person(name) WHERE name = $autostring_0 |              1 |    1 |       2 |            112 |                    0/1 |     0.168 | In Pipeline 0       |
+-------------------+--------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 119, total allocated memory: 6736

Let Semi Apply

The LetSemiApply operator tests for the presence of a pattern predicate, and is a variation of the Apply operator. When a query contains multiple pattern predicates separated with OR, LetSemiApply will be used to evaluate the first of these. It will record the result of evaluating the predicate but will leave any filtering to another operator. In the example, LetSemiApply will be used to check for the presence of the FRIENDS_WITH relationship from each person.

Example 30. LetSemiApply
Query
CYPHER runtime=slotted
MATCH (other:Person)
WHERE (other)-[:FRIENDS_WITH]->(:Person) OR (other)-[:WORKS_IN]->(:Location)
RETURN other.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+--------------------+-----------------------------------------+----------------+------+---------+------------------------+
| Operator           | Details                                 | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+--------------------+-----------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults    | `other.name`                            |             13 |   14 |       0 |                    0/0 |
| |                  +-----------------------------------------+----------------+------+---------+------------------------+
| +Projection        | other.name AS `other.name`              |             13 |   14 |      14 |                    1/0 |
| |                  +-----------------------------------------+----------------+------+---------+------------------------+
| +SelectOrSemiApply | anon_9                                  |             14 |   14 |       0 |                    0/0 |
| |\                 +-----------------------------------------+----------------+------+---------+------------------------+
| | +Filter          | anon_7:Location                         |             14 |    0 |      12 |                    0/0 |
| | |                +-----------------------------------------+----------------+------+---------+------------------------+
| | +Expand(All)     | (other)-[anon_6:WORKS_IN]->(anon_7)     |             14 |   12 |      26 |                   24/0 |
| | |                +-----------------------------------------+----------------+------+---------+------------------------+
| | +Argument        | other                                   |             14 |   12 |       0 |                    0/0 |
| |                  +-----------------------------------------+----------------+------+---------+------------------------+
| +LetSemiApply      |                                         |             14 |   14 |       0 |                    0/0 |
| |\                 +-----------------------------------------+----------------+------+---------+------------------------+
| | +Filter          | anon_5:Person                           |              2 |    0 |       2 |                    0/0 |
| | |                +-----------------------------------------+----------------+------+---------+------------------------+
| | +Expand(All)     | (other)-[anon_4:FRIENDS_WITH]->(anon_5) |              2 |    2 |      33 |                   28/0 |
| | |                +-----------------------------------------+----------------+------+---------+------------------------+
| | +Argument        | other                                   |             14 |   14 |       0 |                    0/0 |
| |                  +-----------------------------------------+----------------+------+---------+------------------------+
| +Filter            | other:Person                            |             14 |   14 |      35 |                    1/0 |
| |                  +-----------------------------------------+----------------+------+---------+------------------------+
| +AllNodesScan      | other                                   |             35 |   35 |      36 |                    1/0 |
+--------------------+-----------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 158, total allocated memory: 64

Let Anti Semi Apply

The LetAntiSemiApply operator tests for the absence of a pattern, and is a variation of the Apply operator. When a query contains multiple negated pattern predicates — i.e. predicates separated with OR, where at least one predicate contains NOT — LetAntiSemiApply will be used to evaluate the first of these. It will record the result of evaluating the predicate but will leave any filtering to another operator. In the example, LetAntiSemiApply will be used to check for the absence of the FRIENDS_WITH relationship from each person.

Example 31. LetAntiSemiApply
Query
CYPHER runtime=slotted
MATCH (other:Person)
WHERE NOT ((other)-[:FRIENDS_WITH]->(:Person)) OR (other)-[:WORKS_IN]->(:Location)
RETURN other.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+--------------------+-----------------------------------------+----------------+------+---------+------------------------+
| Operator           | Details                                 | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+--------------------+-----------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults    | `other.name`                            |             11 |   14 |       0 |                    0/0 |
| |                  +-----------------------------------------+----------------+------+---------+------------------------+
| +Projection        | other.name AS `other.name`              |             11 |   14 |      14 |                    1/0 |
| |                  +-----------------------------------------+----------------+------+---------+------------------------+
| +SelectOrSemiApply | anon_9                                  |             14 |   14 |       0 |                    0/0 |
| |\                 +-----------------------------------------+----------------+------+---------+------------------------+
| | +Filter          | anon_7:Location                         |             14 |    0 |       2 |                    0/0 |
| | |                +-----------------------------------------+----------------+------+---------+------------------------+
| | +Expand(All)     | (other)-[anon_6:WORKS_IN]->(anon_7)     |             14 |    2 |       7 |                    4/0 |
| | |                +-----------------------------------------+----------------+------+---------+------------------------+
| | +Argument        | other                                   |             14 |    2 |       0 |                    0/0 |
| |                  +-----------------------------------------+----------------+------+---------+------------------------+
| +LetAntiSemiApply  |                                         |             14 |   14 |       0 |                    0/0 |
| |\                 +-----------------------------------------+----------------+------+---------+------------------------+
| | +Filter          | anon_5:Person                           |              2 |    0 |       2 |                    0/0 |
| | |                +-----------------------------------------+----------------+------+---------+------------------------+
| | +Expand(All)     | (other)-[anon_4:FRIENDS_WITH]->(anon_5) |              2 |    2 |      33 |                   28/0 |
| | |                +-----------------------------------------+----------------+------+---------+------------------------+
| | +Argument        | other                                   |             14 |   14 |       0 |                    0/0 |
| |                  +-----------------------------------------+----------------+------+---------+------------------------+
| +Filter            | other:Person                            |             14 |   14 |      35 |                    1/0 |
| |                  +-----------------------------------------+----------------+------+---------+------------------------+
| +AllNodesScan      | other                                   |             35 |   35 |      36 |                    1/0 |
+--------------------+-----------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 129, total allocated memory: 64

Select Or Semi Apply

The SelectOrSemiApply operator tests for the presence of a pattern predicate and evaluates a predicate, and is a variation of the Apply operator. This operator allows for the mixing of normal predicates and pattern predicates that check for the presence of a pattern. First, the normal expression predicate is evaluated, and, only if it returns false, is the costly pattern predicate evaluated.

Example 32. SelectOrSemiApply
Query
MATCH (other:Person)
WHERE other.age > 25 OR (other)-[:FRIENDS_WITH]->(:Person)
RETURN other.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+--------------------+-----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator           | Details                                 | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+--------------------+-----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults    | `other.name`                            |             11 |    2 |       0 |                |                        |           | Fused in Pipeline 2 |
| |                  +-----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Projection        | other.name AS `other.name`              |             11 |    2 |       4 |                |                        |           | Fused in Pipeline 2 |
| |                  +-----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +SelectOrSemiApply | other.age > $autoint_0                  |             14 |    2 |       0 |           4200 |                    0/0 |     0.153 | Fused in Pipeline 2 |
| |\                 +-----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| | +Limit           | 1                                       |             14 |    2 |       0 |            752 |                        |           | Fused in Pipeline 1 |
| | |                +-----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Filter          | anon_3:Person                           |              2 |    2 |       2 |                |                        |           | Fused in Pipeline 1 |
| | |                +-----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Expand(All)     | (other)-[anon_2:FRIENDS_WITH]->(anon_3) |              2 |    2 |      32 |                |                        |           | Fused in Pipeline 1 |
| | |                +-----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Argument        | other                                   |             14 |   14 |       0 |           2160 |                    2/0 |     0.376 | Fused in Pipeline 1 |
| |                  +-----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Filter            | other:Person                            |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                  +-----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan      | other                                   |             35 |   35 |      36 |            112 |                    1/0 |     0.166 | Fused in Pipeline 0 |
+--------------------+-----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 74, total allocated memory: 5040

Select Or Anti Semi Apply

The SelectOrAntiSemiApply operator is used to evaluate OR between a predicate and a negative pattern predicate (i.e. a pattern predicate preceded with NOT), and is a variation of the Apply operator. If the predicate returns true, the pattern predicate is not tested. If the predicate returns false or null, SelectOrAntiSemiApply will instead test the pattern predicate.

Example 33. SelectOrAntiSemiApply
Query
MATCH (other:Person)
WHERE other.age > 25 OR NOT (other)-[:FRIENDS_WITH]->(:Person)
RETURN other.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+------------------------+-----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator               | Details                                 | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+------------------------+-----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults        | `other.name`                            |              4 |   12 |       0 |                |                        |           | Fused in Pipeline 3 |
| |                      +-----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Projection            | other.name AS `other.name`              |              4 |   12 |      24 |                |                        |           | Fused in Pipeline 3 |
| |                      +-----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +SelectOrAntiSemiApply | other.age > $autoint_0                  |             14 |   12 |       0 |           4200 |                    0/0 |     0.215 | Fused in Pipeline 3 |
| |\                     +-----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| | +Anti                |                                         |             14 |   12 |       0 |           1256 |                    0/0 |     0.127 | In Pipeline 2       |
| | |                    +-----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| | +Limit               | 1                                       |             14 |    2 |       0 |            752 |                        |           | Fused in Pipeline 1 |
| | |                    +-----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Filter              | anon_3:Person                           |              2 |    2 |       2 |                |                        |           | Fused in Pipeline 1 |
| | |                    +-----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Expand(All)         | (other)-[anon_2:FRIENDS_WITH]->(anon_3) |              2 |    2 |      32 |                |                        |           | Fused in Pipeline 1 |
| | |                    +-----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Argument            | other                                   |             14 |   14 |       0 |           2160 |                    2/0 |     1.109 | Fused in Pipeline 1 |
| |                      +-----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Filter                | other:Person                            |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                      +-----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan          | other                                   |             35 |   35 |      36 |            112 |                    1/0 |     0.160 | Fused in Pipeline 0 |
+------------------------+-----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 94, total allocated memory: 5736

Let Select Or Semi Apply

The LetSelectOrSemiApply operator is planned for pattern predicates that are combined with other predicates using OR. This is a variation of the Apply operator.

Example 34. LetSelectOrSemiApply
Query
CYPHER runtime=slotted
MATCH (other:Person)
WHERE (other)-[:FRIENDS_WITH]->(:Person) OR (other)-[:WORKS_IN]->(:Location) OR other.age = 5
RETURN other.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+-----------------------+-----------------------------------------+----------------+------+---------+------------------------+
| Operator              | Details                                 | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+-----------------------+-----------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults       | `other.name`                            |             13 |   14 |       0 |                    0/0 |
| |                     +-----------------------------------------+----------------+------+---------+------------------------+
| +Projection           | other.name AS `other.name`              |             13 |   14 |      14 |                    1/0 |
| |                     +-----------------------------------------+----------------+------+---------+------------------------+
| +SelectOrSemiApply    | anon_9                                  |             14 |   14 |       0 |                    0/0 |
| |\                    +-----------------------------------------+----------------+------+---------+------------------------+
| | +Filter             | anon_7:Location                         |             14 |    0 |      12 |                    0/0 |
| | |                   +-----------------------------------------+----------------+------+---------+------------------------+
| | +Expand(All)        | (other)-[anon_6:WORKS_IN]->(anon_7)     |             14 |   12 |      26 |                   24/0 |
| | |                   +-----------------------------------------+----------------+------+---------+------------------------+
| | +Argument           | other                                   |             14 |   12 |       0 |                    0/0 |
| |                     +-----------------------------------------+----------------+------+---------+------------------------+
| +LetSelectOrSemiApply | other.age = $autoint_0                  |             14 |   14 |      14 |                    0/0 |
| |\                    +-----------------------------------------+----------------+------+---------+------------------------+
| | +Filter             | anon_5:Person                           |              2 |    0 |       2 |                    0/0 |
| | |                   +-----------------------------------------+----------------+------+---------+------------------------+
| | +Expand(All)        | (other)-[anon_4:FRIENDS_WITH]->(anon_5) |              2 |    2 |      33 |                   28/0 |
| | |                   +-----------------------------------------+----------------+------+---------+------------------------+
| | +Argument           | other                                   |             14 |   14 |       0 |                    0/0 |
| |                     +-----------------------------------------+----------------+------+---------+------------------------+
| +Filter               | other:Person                            |             14 |   14 |      35 |                    1/0 |
| |                     +-----------------------------------------+----------------+------+---------+------------------------+
| +AllNodesScan         | other                                   |             35 |   35 |      36 |                    1/0 |
+-----------------------+-----------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 172, total allocated memory: 64

Let Select Or Anti Semi Apply

The LetSelectOrAntiSemiApply operator is planned for negated pattern predicates — i.e. pattern predicates preceded with NOT — that are combined with other predicates using OR. This operator is a variation of the Apply operator.

Example 35. LetSelectOrAntiSemiApply
Query
CYPHER runtime=slotted
MATCH (other:Person)
WHERE NOT (other)-[:FRIENDS_WITH]->(:Person) OR (other)-[:WORKS_IN]->(:Location) OR other.age = 5
RETURN other.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+---------------------------+-----------------------------------------+----------------+------+---------+------------------------+
| Operator                  | Details                                 | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+---------------------------+-----------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults           | `other.name`                            |             12 |   14 |       0 |                    0/0 |
| |                         +-----------------------------------------+----------------+------+---------+------------------------+
| +Projection               | other.name AS `other.name`              |             12 |   14 |      14 |                    1/0 |
| |                         +-----------------------------------------+----------------+------+---------+------------------------+
| +SelectOrSemiApply        | anon_9                                  |             14 |   14 |       0 |                    0/0 |
| |\                        +-----------------------------------------+----------------+------+---------+------------------------+
| | +Filter                 | anon_7:Location                         |             14 |    0 |       2 |                    0/0 |
| | |                       +-----------------------------------------+----------------+------+---------+------------------------+
| | +Expand(All)            | (other)-[anon_6:WORKS_IN]->(anon_7)     |             14 |    2 |       7 |                    4/0 |
| | |                       +-----------------------------------------+----------------+------+---------+------------------------+
| | +Argument               | other                                   |             14 |    2 |       0 |                    0/0 |
| |                         +-----------------------------------------+----------------+------+---------+------------------------+
| +LetSelectOrAntiSemiApply | other.age = $autoint_0                  |             14 |   14 |      14 |                    0/0 |
| |\                        +-----------------------------------------+----------------+------+---------+------------------------+
| | +Filter                 | anon_5:Person                           |              2 |    0 |       2 |                    0/0 |
| | |                       +-----------------------------------------+----------------+------+---------+------------------------+
| | +Expand(All)            | (other)-[anon_4:FRIENDS_WITH]->(anon_5) |              2 |    2 |      33 |                   28/0 |
| | |                       +-----------------------------------------+----------------+------+---------+------------------------+
| | +Argument               | other                                   |             14 |   14 |       0 |                    0/0 |
| |                         +-----------------------------------------+----------------+------+---------+------------------------+
| +Filter                   | other:Person                            |             14 |   14 |      35 |                    1/0 |
| |                         +-----------------------------------------+----------------+------+---------+------------------------+
| +AllNodesScan             | other                                   |             35 |   35 |      36 |                    1/0 |
+---------------------------+-----------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 143, total allocated memory: 64

Merge

The Merge operator will either read or create nodes and/or relationships.

If matches are found it will execute the provided ON MATCH operations foreach incoming row. If no matches are found instead nodes and relationships are created and all ON CREATE operations are run.

Example 36. Merge
Query
MERGE (p:Person {name: 'Andy'})
ON MATCH SET p.existed = true
ON CREATE SET p.existed = false
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+-------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details                                                                 | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+-------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults |                                                                         |              1 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +-------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +EmptyResult    |                                                                         |              1 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +-------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Merge          | CREATE (p:Person {name: $autostring_0}), ON MATCH SET p.existed = true, |              1 |    1 |       2 |                |                        |           | Fused in Pipeline 0 |
| |               | ON CREATE SET p.existed = false                                         |                |      |         |                |                        |           |                     |
| |               +-------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeIndexSeek  | BTREE INDEX p:Person(name) WHERE name = $autostring_0                   |              1 |    1 |       2 |            112 |                    2/1 |     0.512 | Fused in Pipeline 0 |
+-----------------+-------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 4, total allocated memory: 176

Locking Merge

The LockingMerge operator is just like a normal Merge but will lock the start and end node when creating a relationship if necessary.

Example 37. LockingMerge
Query
MATCH (s:Person {name: 'me'})
MERGE (s)-[:FRIENDS_WITH]->(s)
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details                                               | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults |                                                       |              1 |    0 |       0 |                |                        |           | Fused in Pipeline 1 |
| |               +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +EmptyResult    |                                                       |              1 |    0 |       0 |                |                        |           | Fused in Pipeline 1 |
| |               +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Apply          |                                                       |              1 |    1 |       0 |                |                        |           |                     |
| |\              +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +LockingMerge | CREATE (s)-[anon_0:FRIENDS_WITH]->(s), LOCK(s)        |              1 |    1 |       1 |                |                        |           | Fused in Pipeline 1 |
| | |             +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Expand(Into) | (s)-[anon_0:FRIENDS_WITH]->(s)                        |              0 |    0 |       8 |            888 |                        |           | Fused in Pipeline 1 |
| | |             +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Argument     | s                                                     |              1 |    3 |       0 |           2152 |                    3/0 |     0.616 | Fused in Pipeline 1 |
| |               +-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +NodeIndexSeek  | BTREE INDEX s:Person(name) WHERE name = $autostring_0 |              1 |    1 |       2 |            112 |                    0/1 |     0.235 | In Pipeline 0       |
+-----------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 11, total allocated memory: 2232

Roll Up Apply

The RollUpApply operator is used to execute an expression which takes as input a pattern, and returns a list with content from the matched pattern; for example, when using a pattern expression or pattern comprehension in a query. This operator is a variation of the Apply operator.

Example 38. RollUpApply
Query
CYPHER runtime=slotted
MATCH (p:Person)
RETURN p.name, [(p)-[:WORKS_IN]->(location) | location.name] AS cities
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+-----------------+-----------------------------------+----------------+------+---------+------------------------+
| Operator        | Details                           | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+-----------------+-----------------------------------+----------------+------+---------+------------------------+
| +ProduceResults | `p.name`, cities                  |             14 |   14 |       0 |                    0/0 |
| |               +-----------------------------------+----------------+------+---------+------------------------+
| +Projection     | p.name AS `p.name`                |             14 |   14 |      14 |                    0/0 |
| |               +-----------------------------------+----------------+------+---------+------------------------+
| +RollUpApply    | cities, anon_0                    |             14 |   14 |       0 |                    0/0 |
| |\              +-----------------------------------+----------------+------+---------+------------------------+
| | +Projection   | location.name AS anon_0           |              6 |   15 |      15 |                    1/0 |
| | |             +-----------------------------------+----------------+------+---------+------------------------+
| | +Expand(All)  | (p)-[anon_2:WORKS_IN]->(location) |              6 |   15 |      33 |                   28/0 |
| | |             +-----------------------------------+----------------+------+---------+------------------------+
| | +Argument     | p                                 |             14 |   14 |       0 |                    0/0 |
| |               +-----------------------------------+----------------+------+---------+------------------------+
| +Filter         | p:Person                          |             14 |   14 |      35 |                    1/0 |
| |               +-----------------------------------+----------------+------+---------+------------------------+
| +AllNodesScan   | p                                 |             35 |   35 |      36 |                    1/0 |
+-----------------+-----------------------------------+----------------+------+---------+------------------------+

Total database accesses: 133, total allocated memory: 64

Argument

The Argument operator indicates the variable to be used as an argument to the right-hand side of an Apply operator.

Example 39. Argument
Query
MATCH (s:Person {name: 'me'})
MERGE (s)-[:FRIENDS_WITH]->(s)
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details                                               | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults |                                                       |              1 |    0 |       0 |                |                        |           | Fused in Pipeline 1 |
| |               +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +EmptyResult    |                                                       |              1 |    0 |       0 |                |                        |           | Fused in Pipeline 1 |
| |               +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Apply          |                                                       |              1 |    1 |       0 |                |                        |           |                     |
| |\              +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +LockingMerge | CREATE (s)-[anon_0:FRIENDS_WITH]->(s), LOCK(s)        |              1 |    1 |       1 |                |                        |           | Fused in Pipeline 1 |
| | |             +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Expand(Into) | (s)-[anon_0:FRIENDS_WITH]->(s)                        |              0 |    0 |       8 |            888 |                        |           | Fused in Pipeline 1 |
| | |             +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Argument     | s                                                     |              1 |    3 |       0 |           2152 |                    3/0 |     0.894 | Fused in Pipeline 1 |
| |               +-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +NodeIndexSeek  | BTREE INDEX s:Person(name) WHERE name = $autostring_0 |              1 |    1 |       2 |            112 |                    0/1 |     1.055 | In Pipeline 0       |
+-----------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 11, total allocated memory: 2232

Expand All

Given a start node, and depending on the pattern relationship, the Expand(All) operator will traverse incoming or outgoing relationships.

Example 40. Expand(All)
Query
MATCH (p:Person {name: 'me'})-[:FRIENDS_WITH]->(fof)
RETURN fof
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details                                               | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | fof                                                   |              0 |    1 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Expand(All)    | (p)-[anon_0:FRIENDS_WITH]->(fof)                      |              0 |    1 |       3 |                |                        |           | Fused in Pipeline 0 |
| |               +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeIndexSeek  | BTREE INDEX p:Person(name) WHERE name = $autostring_0 |              1 |    1 |       2 |            112 |                    4/1 |     0.533 | Fused in Pipeline 0 |
+-----------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 5, total allocated memory: 176

Expand Into

When both the start and end node have already been found, the Expand(Into) operator is used to find all relationships connecting the two nodes. As both the start and end node of the relationship are already in scope, the node with the smallest degree will be used. This can make a noticeable difference when dense nodes appear as end points.

Example 41. Expand(Into)
Query
MATCH (p:Person {name: 'me'})-[:FRIENDS_WITH]->(fof)-->(p)
RETURN fof
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details                                               | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | fof                                                   |              0 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter         | not anon_0 = anon_1                                   |              0 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Expand(Into)   | (p)-[anon_0:FRIENDS_WITH]->(fof)                      |              0 |    0 |       0 |              0 |                        |           | Fused in Pipeline 0 |
| |               +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Expand(All)    | (p)<-[anon_1]-(fof)                                   |              0 |    0 |       3 |                |                        |           | Fused in Pipeline 0 |
| |               +-------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeIndexSeek  | BTREE INDEX p:Person(name) WHERE name = $autostring_0 |              1 |    1 |       2 |            112 |                    2/1 |     0.314 | Fused in Pipeline 0 |
+-----------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 5, total allocated memory: 192

Optional Expand All

The OptionalExpand(All) operator is analogous to Expand(All), apart from when no relationships match the direction, type and property predicates. In this situation, OptionalExpand(all) will return a single row with the relationship and end node set to null.

Example 42. OptionalExpand(All)
Query
MATCH (p:Person)
OPTIONAL MATCH (p)-[works_in:WORKS_IN]->(l)
  WHERE works_in.duration > 180
RETURN p, l
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+----------------------+-------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator             | Details                                                           | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+----------------------+-------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults      | p, l                                                              |             14 |   15 |       1 |                |                        |           | Fused in Pipeline 0 |
| |                    +-------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +OptionalExpand(All) | (p)-[works_in:WORKS_IN]->(l) WHERE works_in.duration > $autoint_0 |             14 |   15 |      33 |                |                        |           | Fused in Pipeline 0 |
| |                    +-------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter              | p:Person                                                          |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                    +-------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan        | p                                                                 |             35 |   35 |      36 |            112 |                    5/0 |     0.764 | Fused in Pipeline 0 |
+----------------------+-------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 70, total allocated memory: 176

Optional Expand Into

The OptionalExpand(Into) operator is analogous to Expand(Into), apart from when no matching relationships are found. In this situation, OptionalExpand(Into) will return a single row with the relationship and end node set to null. As both the start and end node of the relationship are already in scope, the node with the smallest degree will be used. This can make a noticeable difference when dense nodes appear as end points.

Example 43. OptionalExpand(Into)
Query
MATCH (p:Person)-[works_in:WORKS_IN]->(l)
OPTIONAL MATCH (l)-->(p)
RETURN p
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------------+------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator              | Details                      | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------------+------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults       | p                            |             15 |   15 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                     +------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +OptionalExpand(Into) | (l)-[anon_0]->(p)            |             15 |   15 |     105 |           3352 |                        |           | Fused in Pipeline 0 |
| |                     +------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Expand(All)          | (p)-[works_in:WORKS_IN]->(l) |             15 |   15 |      19 |                |                        |           | Fused in Pipeline 0 |
| |                     +------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter               | p:Person                     |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                     +------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan         | p                            |             35 |   35 |      36 |            112 |                    6/0 |     1.131 | Fused in Pipeline 0 |
+-----------------------+------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 160, total allocated memory: 3432

VarLength Expand All

Given a start node, the VarLengthExpand(All) operator will traverse variable-length relationships.

Example 44. VarLengthExpand(All)
Query
MATCH (p:Person)-[:FRIENDS_WITH *1..2]-(q:Person)
RETURN p, q
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------------+-----------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator              | Details                           | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------------+-----------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults       | p, q                              |              4 |    6 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                     +-----------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter               | q:Person                          |              4 |    6 |       6 |                |                        |           | Fused in Pipeline 0 |
| |                     +-----------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +VarLengthExpand(All) | (p)-[anon_0:FRIENDS_WITH*..2]-(q) |              4 |    6 |      47 |            128 |                        |           | Fused in Pipeline 0 |
| |                     +-----------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter               | p:Person                          |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                     +-----------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan         | p                                 |             35 |   35 |      36 |            112 |                    7/0 |     1.033 | Fused in Pipeline 0 |
+-----------------------+-----------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 89, total allocated memory: 208

VarLength Expand Into

When both the start and end node have already been found, the VarLengthExpand(Into) operator is used to find all variable-length relationships connecting the two nodes.

Example 45. VarLengthExpand(Into)
Query
MATCH (p:Person)-[:FRIENDS_WITH *1..2]-(p:Person)
RETURN p
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+------------------------+-----------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator               | Details                           | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+------------------------+-----------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults        | p                                 |              0 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                      +-----------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +VarLengthExpand(Into) | (p)-[anon_0:FRIENDS_WITH*..2]-(p) |              0 |    0 |      47 |            128 |                        |           | Fused in Pipeline 0 |
| |                      +-----------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter                | p:Person                          |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                      +-----------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan          | p                                 |             35 |   35 |      36 |            112 |                    4/0 |     0.622 | Fused in Pipeline 0 |
+------------------------+-----------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 83, total allocated memory: 192

VarLength Expand Pruning

Given a start node, the VarLengthExpand(Pruning) operator will traverse variable-length relationships much like the VarLengthExpand(All) operator. However, as an optimization, some paths will not be explored if they are guaranteed to produce an end node that has already been found (by means of a previous path traversal). This will only be used in cases where the individual paths are not of interest. This operator guarantees that all the end nodes produced will be unique.

Example 46. VarLengthExpand(Pruning)
Query
MATCH (p:Person)-[:FRIENDS_WITH *3..4]-(q:Person)
RETURN DISTINCT p, q
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+---------------------------+------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                  | Details                      | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+---------------------------+------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults           | p, q                         |              0 |    0 |       0 |                |                    0/0 |     0.049 | In Pipeline 1       |
| |                         +------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Distinct                 | p, q                         |              0 |    0 |       0 |            224 |                    0/0 |     4.258 | In Pipeline 1       |
| |                         +------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Filter                   | q:Person                     |              0 |    0 |       0 |                |                    0/0 |     0.165 | In Pipeline 1       |
| |                         +------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +VarLengthExpand(Pruning) | (p)-[:FRIENDS_WITH*3..4]-(q) |              0 |    0 |      32 |           1128 |                        |           | In Pipeline 1       |
| |                         +------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Filter                   | p:Person                     |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                         +------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan             | p                            |             35 |   35 |      36 |            112 |                    1/0 |     0.224 | Fused in Pipeline 0 |
+---------------------------+------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 68, total allocated memory: 1208

Assert Same Node

The AssertSameNode operator is used to ensure that no unique constraints are violated in the slotted and interpreted runtime. The example looks for the presence of a team with the supplied name and id, and if one does not exist, it will be created. Owing to the existence of two unique constraints on :Team(name) and :Team(id), any node that would be found by the UniqueIndexSeek must be the very same node, or the constraints would be violated.

Example 47. AssertSameNode
Query
CYPHER runtime=slotted
MERGE (t:Team {name: 'Engineering', id: 42})
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+---------------------------------+-------------------------------------------------------+----------------+------+---------+------------------------+
| Operator                        | Details                                               | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+---------------------------------+-------------------------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults                 |                                                       |              1 |    0 |       0 |                    0/0 |
| |                               +-------------------------------------------------------+----------------+------+---------+------------------------+
| +EmptyResult                    |                                                       |              1 |    0 |       0 |                    0/0 |
| |                               +-------------------------------------------------------+----------------+------+---------+------------------------+
| +Merge                          | CREATE (t:Team {name: $autostring_0, id: $autoint_1}) |              1 |    1 |       0 |                    0/0 |
| |                               +-------------------------------------------------------+----------------+------+---------+------------------------+
| +AssertSameNode                 | t                                                     |              0 |    1 |       0 |                    0/0 |
| |\                              +-------------------------------------------------------+----------------+------+---------+------------------------+
| | +NodeUniqueIndexSeek(Locking) | UNIQUE t:Team(id) WHERE id = $autoint_1               |              1 |    1 |       1 |                    0/1 |
| |                               +-------------------------------------------------------+----------------+------+---------+------------------------+
| +NodeUniqueIndexSeek(Locking)   | UNIQUE t:Team(name) WHERE name = $autostring_0        |              1 |    1 |       1 |                    0/1 |
+---------------------------------+-------------------------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 2, total allocated memory: 64

Empty Result

The EmptyResult operator eagerly loads all incoming data and discards it.

Example 48. EmptyResult
Query
CREATE (:Person)
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+-----------------+----------------+------+---------+------------------------+-----------+---------------------+
| Operator        | Details         | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+-----------------+----------------+------+---------+------------------------+-----------+---------------------+
| +ProduceResults |                 |              1 |    0 |       0 |                        |           | Fused in Pipeline 0 |
| |               +-----------------+----------------+------+---------+                        |           +---------------------+
| +EmptyResult    |                 |              1 |    0 |       0 |                        |           | Fused in Pipeline 0 |
| |               +-----------------+----------------+------+---------+                        |           +---------------------+
| +Create         | (anon_0:Person) |              1 |    1 |       1 |                    0/0 |     0.000 | Fused in Pipeline 0 |
+-----------------+-----------------+----------------+------+---------+------------------------+-----------+---------------------+

Total database accesses: 1, total allocated memory: 176

Produce Results

The ProduceResults operator prepares the result so that it is consumable by the user, such as transforming internal values to user values. It is present in every single query that returns data to the user, and has little bearing on performance optimisation.

Example 49. ProduceResults
Query
MATCH (n)
RETURN n
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+---------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+---------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | n       |             35 |   35 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +---------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan   | n       |             35 |   35 |      36 |            112 |                    3/0 |     0.853 | Fused in Pipeline 0 |
+-----------------+---------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 36, total allocated memory: 176

Load CSV

The LoadCSV operator loads data from a CSV source into the query. It is used whenever the LOAD CSV clause is used in a query.

Example 50. LoadCSV
Query
LOAD CSV FROM 'https://neo4j.com/docs/cypher-refcard/3.3/csv/artists.csv' AS line
RETURN line
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+---------+----------------+------+---------+----------------+------------------------+-----------+---------------+
| Operator        | Details | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other         |
+-----------------+---------+----------------+------+---------+----------------+------------------------+-----------+---------------+
| +ProduceResults | line    |             10 |    4 |       0 |                |                    0/0 |     0.414 | In Pipeline 1 |
| |               +---------+----------------+------+---------+----------------+------------------------+-----------+---------------+
| +LoadCSV        | line    |             10 |    4 |       0 |            104 |                        |           | In Pipeline 1 |
+-----------------+---------+----------------+------+---------+----------------+------------------------+-----------+---------------+

Total database accesses: 0, total allocated memory: 176

Hash joins in general

Hash joins have two inputs: the build input and probe input. The query planner assigns these roles so that the smaller of the two inputs is the build input. The build input is pulled in eagerly, and is used to build a probe table. Once this is complete, the probe table is checked for each row coming from the probe input side.

In query plans, the build input is always the left operator, and the probe input the right operator.

There are four hash join operators:

Node Hash Join

The NodeHashJoin operator is a variation of the hash join. NodeHashJoin executes the hash join on node ids. As primitive types and arrays can be used, it can be done very efficiently.

Example 51. NodeHashJoin
Query
MATCH (bob:Person {name: 'Bob'})-[:WORKS_IN]->(loc)<-[:WORKS_IN]-(matt:Person {name: 'Mattis'})
RETURN loc.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+------------------+----------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator         | Details                                                  | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+------------------+----------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults  | `loc.name`                                               |             10 |    0 |       0 |                |                    0/0 |     0.000 | In Pipeline 2       |
| |                +----------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Projection      | loc.name AS `loc.name`                                   |             10 |    0 |       0 |                |                    0/0 |     0.000 | In Pipeline 2       |
| |                +----------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Filter          | not anon_0 = anon_1                                      |             10 |    0 |       0 |                |                    0/0 |     0.000 | In Pipeline 2       |
| |                +----------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +NodeHashJoin    | loc                                                      |             10 |    0 |       0 |           3680 |                        |     0.022 | In Pipeline 2       |
| |\               +----------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| | +Expand(All)   | (matt)-[anon_1:WORKS_IN]->(loc)                          |             19 |    0 |       0 |                |                        |           | Fused in Pipeline 1 |
| | |              +----------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +NodeIndexSeek | BTREE INDEX matt:Person(name) WHERE name = $autostring_1 |              1 |    0 |       1 |            112 |                    1/0 |     0.199 | Fused in Pipeline 1 |
| |                +----------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Expand(All)     | (bob)-[anon_0:WORKS_IN]->(loc)                           |             19 |    1 |       3 |                |                        |           | Fused in Pipeline 0 |
| |                +----------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeIndexSeek   | BTREE INDEX bob:Person(name) WHERE name = $autostring_0  |              1 |    1 |       2 |            112 |                    3/0 |     0.349 | Fused in Pipeline 0 |
+------------------+----------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 6, total allocated memory: 3872

Value Hash Join

The ValueHashJoin operator is a variation of the hash join. This operator allows for arbitrary values to be used as the join key. It is most frequently used to solve predicates of the form: n.prop1 = m.prop2 (i.e. equality predicates between two property columns).

Example 52. ValueHashJoin
Query
MATCH
  (p:Person),
  (q:Person)
WHERE p.age = q.age
RETURN p, q
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+---------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details       | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+---------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | p, q          |             10 |    0 |       0 |                |                    0/0 |     0.000 | In Pipeline 2       |
| |               +---------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ValueHashJoin  | p.age = q.age |             10 |    0 |       0 |            344 |                        |           | In Pipeline 2       |
| |\              +---------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| | +Filter       | q:Person      |             14 |    0 |       0 |                |                        |           | Fused in Pipeline 1 |
| | |             +---------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +AllNodesScan | q             |             35 |    0 |       0 |            112 |                    0/0 |     0.000 | Fused in Pipeline 1 |
| |               +---------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Filter         | p:Person      |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +---------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan   | p             |             35 |   35 |      36 |            112 |                    1/0 |     0.340 | Fused in Pipeline 0 |
+-----------------+---------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 36, total allocated memory: 648

Node Left/Right Outer Hash Join

The NodeLeftOuterHashJoin and NodeRightOuterHashJoin operators are variations of the hash join. The query below can be planned with either a left or a right outer join. The decision depends on the cardinalities of the left-hand and right-hand sides; i.e. how many rows would be returned, respectively, for (a:Person) and (a)-→(b:Person). If (a:Person) returns fewer results than (a)-→(b:Person), a left outer join — indicated by NodeLeftOuterHashJoin — is planned. On the other hand, if (a:Person) returns more results than (a)-→(b:Person), a right outer join — indicated by NodeRightOuterHashJoin — is planned instead.

Example 53. NodeRightOuterHashJoin
Query
MATCH (a:Person)
OPTIONAL MATCH (a)-->(b:Person)
USING JOIN ON a
RETURN a.name, b.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-------------------------+------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                | Details                                              | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-------------------------+------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults         | `a.name`, `b.name`                                   |             14 |   14 |       0 |                |                    0/0 |     0.122 | In Pipeline 2       |
| |                       +------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Projection             | cache[a.name] AS `a.name`, cache[b.name] AS `b.name` |             14 |   14 |      24 |                |                    0/0 |     0.287 | In Pipeline 2       |
| |                       +------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +NodeRightOuterHashJoin | a                                                    |             14 |   14 |       0 |           6176 |                        |     0.377 | In Pipeline 2       |
| |\                      +------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| | +Filter               | a:Person                                             |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 1 |
| | |                     +------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +AllNodesScan         | a                                                    |             35 |   35 |      36 |            112 |                    0/0 |     0.170 | Fused in Pipeline 1 |
| |                       +------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +CacheProperties        | cache[a.name], cache[b.name]                         |              2 |    2 |       6 |                |                        |           | Fused in Pipeline 0 |
| |                       +------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Expand(All)            | (b)<-[anon_0]-(a)                                    |              2 |    2 |      19 |                |                        |           | Fused in Pipeline 0 |
| |                       +------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter                 | b:Person                                             |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                       +------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan           | b                                                    |             35 |   35 |      36 |            112 |                    4/0 |     0.347 | Fused in Pipeline 0 |
+-------------------------+------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 121, total allocated memory: 6264

Triadic Selection

The TriadicSelection operator is used to solve triangular queries, such as the very common 'find my friend-of-friends that are not already my friend'. It does so by putting all the friends into a set, and uses the set to check if the friend-of-friends are already connected to me. The example finds the names of all friends of my friends that are not already my friends.

Example 54. TriadicSelection
Query
CYPHER runtime=slotted
MATCH (me:Person)-[:FRIENDS_WITH]-()-[:FRIENDS_WITH]-(other)
WHERE NOT (me)-[:FRIENDS_WITH]-(other)
RETURN other.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+-------------------+----------------------------------------+----------------+------+---------+------------------------+
| Operator          | Details                                | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+-------------------+----------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults   | `other.name`                           |              0 |    2 |       0 |                    0/0 |
| |                 +----------------------------------------+----------------+------+---------+------------------------+
| +Projection       | other.name AS `other.name`             |              0 |    2 |       2 |                    1/0 |
| |                 +----------------------------------------+----------------+------+---------+------------------------+
| +TriadicSelection | WHERE NOT (me)--(other)                |              0 |    2 |       0 |                    0/0 |
| |\                +----------------------------------------+----------------+------+---------+------------------------+
| | +Filter         | not anon_2 = anon_4                    |              0 |    2 |       0 |                    0/0 |
| | |               +----------------------------------------+----------------+------+---------+------------------------+
| | +Expand(All)    | (anon_3)-[anon_4:FRIENDS_WITH]-(other) |              0 |    6 |      14 |                    8/0 |
| | |               +----------------------------------------+----------------+------+---------+------------------------+
| | +Argument       | anon_3, anon_2                         |              4 |    4 |       0 |                    0/0 |
| |                 +----------------------------------------+----------------+------+---------+------------------------+
| +Expand(All)      | (me)-[anon_2:FRIENDS_WITH]-(anon_3)    |              4 |    4 |      33 |                   28/0 |
| |                 +----------------------------------------+----------------+------+---------+------------------------+
| +Filter           | me:Person                              |             14 |   14 |      35 |                    1/0 |
| |                 +----------------------------------------+----------------+------+---------+------------------------+
| +AllNodesScan     | me                                     |             35 |   35 |      36 |                    1/0 |
+-------------------+----------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 120, total allocated memory: 64

Triadic Build

The TriadicBuild operator is used in conjunction with TriadicFilter to solve triangular queries, such as the very common 'find my friend-of-friends that are not already my friend'. These two operators are specific to Pipelined runtime and together perform the same logic as TriadicSelection does for other runtimes. TriadicBuild builds a set of all friends, which is later used by TriadicFilter. The example finds the names of all friends of my friends that are not already my friends.

Example 55. TriadicBuild
Query
CYPHER runtime=pipelined
MATCH (me:Person)-[:FRIENDS_WITH]-()-[:FRIENDS_WITH]-(other)
WHERE NOT (me)-[:FRIENDS_WITH]-(other)
RETURN other.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details                                | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | `other.name`                           |              0 |    2 |       0 |                |                    0/0 |     0.121 | In Pipeline 3       |
| |               +----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Projection     | other.name AS `other.name`             |              0 |    2 |       4 |                |                    2/0 |     0.092 | In Pipeline 3       |
| |               +----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +TriadicFilter  | WHERE NOT (me)--(other)                |              0 |    2 |       0 |           6984 |                    0/0 |     0.122 | In Pipeline 3       |
| |               +----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Apply          |                                        |              0 |    2 |       0 |                |                    0/0 |           |                     |
| |\              +----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| | +Filter       | not anon_2 = anon_4                    |              0 |    2 |       0 |                |                        |           | Fused in Pipeline 2 |
| | |             +----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Expand(All)  | (anon_3)-[anon_4:FRIENDS_WITH]-(other) |              0 |    6 |      14 |                |                        |           | Fused in Pipeline 2 |
| | |             +----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Argument     | anon_3, anon_2                         |              4 |    4 |       0 |           4200 |                    0/0 |     0.397 | Fused in Pipeline 2 |
| |               +----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +TriadicBuild   | (me)--(anon_3)                         |              4 |    4 |       0 |           3392 |                    0/0 |     0.481 | In Pipeline 1       |
| |               +----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Expand(All)    | (me)-[anon_2:FRIENDS_WITH]-(anon_3)    |              4 |    4 |      19 |                |                        |           | Fused in Pipeline 0 |
| |               +----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter         | me:Person                              |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan   | me                                     |             35 |   35 |      36 |            112 |                    2/0 |     0.584 | Fused in Pipeline 0 |
+-----------------+----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 73, total allocated memory: 7248

Triadic Filter

The TriadicFilter operator is used in conjunction with TriadicBuild to solve triangular queries, such as the very common 'find my friend-of-friends that are not already my friend'. These two operators are specific to Pipelined runtime and together perform the same logic as TriadicSelection does for other runtimes. TriadicFilter uses a set of friends previously built by TriadicBuild to check if the friend-of-friends are already connected to me. The example finds the names of all friends of my friends that are not already my friends.

Example 56. TriadicFilter
Query
CYPHER runtime=pipelined
MATCH (me:Person)-[:FRIENDS_WITH]-()-[:FRIENDS_WITH]-(other)
WHERE NOT (me)-[:FRIENDS_WITH]-(other)
RETURN other.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details                                | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | `other.name`                           |              0 |    2 |       0 |                |                    0/0 |     0.061 | In Pipeline 3       |
| |               +----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Projection     | other.name AS `other.name`             |              0 |    2 |       4 |                |                    2/0 |     0.148 | In Pipeline 3       |
| |               +----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +TriadicFilter  | WHERE NOT (me)--(other)                |              0 |    2 |       0 |           6984 |                    0/0 |     0.411 | In Pipeline 3       |
| |               +----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Apply          |                                        |              0 |    2 |       0 |                |                    0/0 |           |                     |
| |\              +----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| | +Filter       | not anon_2 = anon_4                    |              0 |    2 |       0 |                |                        |           | Fused in Pipeline 2 |
| | |             +----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Expand(All)  | (anon_3)-[anon_4:FRIENDS_WITH]-(other) |              0 |    6 |      14 |                |                        |           | Fused in Pipeline 2 |
| | |             +----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Argument     | anon_3, anon_2                         |              4 |    4 |       0 |           4200 |                    0/0 |     0.362 | Fused in Pipeline 2 |
| |               +----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +TriadicBuild   | (me)--(anon_3)                         |              4 |    4 |       0 |           3392 |                    0/0 |     3.763 | In Pipeline 1       |
| |               +----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Expand(All)    | (me)-[anon_2:FRIENDS_WITH]-(anon_3)    |              4 |    4 |      19 |                |                        |           | Fused in Pipeline 0 |
| |               +----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter         | me:Person                              |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan   | me                                     |             35 |   35 |      36 |            112 |                    2/0 |     0.279 | Fused in Pipeline 0 |
+-----------------+----------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 73, total allocated memory: 7248

Cartesian Product

The CartesianProduct operator produces a cartesian product of the two inputs — each row coming from the left child operator will be combined with all the rows from the right child operator. CartesianProduct generally exhibits bad performance and ought to be avoided if possible.

Example 57. CartesianProduct
Query
MATCH
  (p:Person),
  (t:Team)
RETURN p, t
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-------------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator          | Details  | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-------------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults   | p, t     |            140 |  140 |       0 |                |                    2/0 |     1.868 | In Pipeline 2       |
| |                 +----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +CartesianProduct |          |            140 |  140 |       0 |           3656 |                        |     0.528 | In Pipeline 2       |
| |\                +----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| | +Filter         | t:Team   |             10 |   10 |       0 |                |                        |           | Fused in Pipeline 1 |
| | |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| | +AllNodesScan   | t        |             35 |   35 |      36 |            128 |                    0/0 |     0.123 | Fused in Pipeline 1 |
| |                 +----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Filter           | p:Person |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                 +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan     | p        |             35 |   35 |      36 |            112 |                    1/0 |     0.164 | Fused in Pipeline 0 |
+-------------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 72, total allocated memory: 3736

Foreach

The Foreach operator executes a nested loop between the left child operator and the right child operator. In an analogous manner to the Apply operator, it takes a row from the left-hand side and, using the Argument operator, provides it to the operator tree on the right-hand side. Foreach will yield all the rows coming in from the left-hand side; all results from the right-hand side are pulled in and discarded.

Example 58. Foreach
Query
CYPHER runtime=slotted
FOREACH (value IN [1,2,3] | CREATE (:Person {age: value}))
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+-----------------+---------------------------------------------------------+----------------+------+---------+------------------------+
| Operator        | Details                                                 | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+-----------------+---------------------------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults |                                                         |              1 |    0 |       0 |                    0/0 |
| |               +---------------------------------------------------------+----------------+------+---------+------------------------+
| +EmptyResult    |                                                         |              1 |    0 |       0 |                    0/0 |
| |               +---------------------------------------------------------+----------------+------+---------+------------------------+
| +Foreach        | value IN [1, 2, 3], CREATE (anon_0:Person {age: value}) |              1 |    1 |       9 |                    0/0 |
+-----------------+---------------------------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 9, total allocated memory: 64

Eager

For isolation purposes, the Eager operator ensures that operations affecting subsequent operations are executed fully for the whole dataset before continuing execution.

Information from the stores is fetched in a lazy manner; i.e. the pattern matching might not be fully exhausted before updates are applied. To guarantee reasonable semantics, the query planner will insert Eager operators into the query plan to prevent updates from influencing pattern matching; this scenario is exemplified by the query below, where the DELETE clause influences the MATCH clause.

The Eager operator can cause high memory usage when importing data or migrating graph structures. In such cases, the operations should be split into simpler steps; e.g. importing nodes and relationships separately. Alternatively, the records to be updated can be returned, followed by an update statement.

Example 59. Eager
Query
MATCH (a)-[r]-(b)
DELETE r, a, b
MERGE ()
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+----------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details              | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+----------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults |                      |             36 |    0 |       0 |                |                        |           | Fused in Pipeline 3 |
| |               +----------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +EmptyResult    |                      |             36 |    0 |       0 |                |                        |           | Fused in Pipeline 3 |
| |               +----------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Apply          |                      |             36 |  504 |       0 |                |                        |           |                     |
| |\              +----------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Merge        | CREATE (anon_0)      |             36 |  504 |       0 |                |                        |           | Fused in Pipeline 3 |
| | |             +----------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +AllNodesScan | anon_0               |           1260 |  504 |     540 |          32872 |                    0/0 |     0.794 | Fused in Pipeline 3 |
| |               +----------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Eager          |                      |             36 |   36 |       0 |          24696 |                    0/0 |     0.081 | In Pipeline 2       |
| |               +----------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Delete         | b                    |             36 |   36 |       9 |                |                        |           | Fused in Pipeline 1 |
| |               +----------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Delete         | a                    |             36 |   36 |      12 |                |                        |           | Fused in Pipeline 1 |
| |               +----------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Delete         | r                    |             36 |   36 |      18 |                |                        |           | Fused in Pipeline 1 |
| |               +----------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Eager          | delete overlap: b, r |             36 |   36 |       0 |          24696 |                    2/0 |     1.629 | Fused in Pipeline 1 |
| |               +----------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Expand(All)    | (a)-[r]-(b)          |             36 |   36 |      36 |                |                        |           | Fused in Pipeline 0 |
| |               +----------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan   | a                    |             35 |   35 |      36 |            112 |                    2/0 |     0.245 | Fused in Pipeline 0 |
+-----------------+----------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 651, total allocated memory: 33000

Eager Aggregation

The EagerAggregation operator evaluates a grouping expression and uses the result to group rows into different groupings. For each of these groupings, EagerAggregation will then evaluate all aggregation functions and return the result. To do this, EagerAggregation, as the name implies, needs to pull in all data eagerly from its source and build up state, which leads to increased memory pressure in the system.

Example 60. EagerAggregation
Query
MATCH (l:Location)<-[:WORKS_IN]-(p:Person)
RETURN
  l.name AS location,
  collect(p.name) AS people
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-------------------+------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator          | Details                                              | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-------------------+------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults   | location, people                                     |              4 |    6 |       0 |                |                    0/0 |     0.138 | In Pipeline 1       |
| |                 +------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +EagerAggregation | cache[l.name] AS location, collect(p.name) AS people |              4 |    6 |      30 |           3168 |                        |           | Fused in Pipeline 0 |
| |                 +------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter           | p:Person                                             |             15 |   15 |      15 |                |                        |           | Fused in Pipeline 0 |
| |                 +------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Expand(All)      | (l)<-[anon_0:WORKS_IN]-(p)                           |             15 |   15 |      16 |                |                        |           | Fused in Pipeline 0 |
| |                 +------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +CacheProperties  | cache[l.name]                                        |             10 |   10 |      10 |                |                        |           | Fused in Pipeline 0 |
| |                 +------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter           | l:Location                                           |             10 |   10 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                 +------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan     | l                                                    |             35 |   35 |      36 |            112 |                    4/0 |     0.484 | Fused in Pipeline 0 |
+-------------------+------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 107, total allocated memory: 3248

Ordered Aggregation

The OrderedAggregation operator is an optimization of the EagerAggregation operator that takes advantage of the ordering of the incoming rows. This operator uses lazy evaluation and has a lower memory pressure in the system than the EagerAggregation operator.

Example 61. OrderedAggregation
Query
MATCH (p:Person)
WHERE p.name STARTS WITH 'P'
RETURN p.name, count(*) AS count
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------------+--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------+
| Operator              | Details                                                                        | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Ordered by | Other         |
+-----------------------+--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------+
| +ProduceResults       | `p.name`, count                                                                |              0 |    2 |       0 |                |                    0/0 |     0.060 | p.name ASC | In Pipeline 1 |
| |                     +--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------+
| +OrderedAggregation   | cache[p.name] AS `p.name`, count(*) AS count                                   |              0 |    2 |       0 |           1832 |                    0/0 |     0.154 | p.name ASC | In Pipeline 1 |
| |                     +--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------+
| +NodeIndexSeekByRange | BTREE INDEX p:Person(name) WHERE name STARTS WITH $autostring_0, cache[p.name] |              0 |    2 |       3 |            112 |                    0/1 |     0.711 | p.name ASC | In Pipeline 0 |
+-----------------------+--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------+

Total database accesses: 3, total allocated memory: 1896

Node Count From Count Store

The NodeCountFromCountStore operator uses the count store to answer questions about node counts. This is much faster than the EagerAggregation operator which achieves the same result by actually counting. However, as the count store only stores a limited range of combinations, EagerAggregation will still be used for more complex queries. For example, we can get counts for all nodes, and nodes with a label, but not nodes with more than one label.

Example 62. NodeCountFromCountStore
Query
MATCH (p:Person)
RETURN count(p) AS people
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+--------------------------+------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                 | Details                      | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+--------------------------+------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults          | people                       |              1 |    1 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                        +------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeCountFromCountStore | count( (:Person) ) AS people |              1 |    1 |       1 |            112 |                    0/0 |     0.187 | Fused in Pipeline 0 |
+--------------------------+------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 1, total allocated memory: 176

Relationship Count From Count Store

The RelationshipCountFromCountStore operator uses the count store to answer questions about relationship counts. This is much faster than the EagerAggregation operator which achieves the same result by actually counting. However, as the count store only stores a limited range of combinations, EagerAggregation will still be used for more complex queries. For example, we can get counts for all relationships, relationships with a type, relationships with a label on one end, but not relationships with labels on both end nodes.

Example 63. RelationshipCountFromCountStore
Query
MATCH (p:Person)-[r:WORKS_IN]->()
RETURN count(r) AS jobs
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+----------------------------------+--------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                         | Details                                    | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+----------------------------------+--------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                  | jobs                                       |              1 |    1 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                                +--------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +RelationshipCountFromCountStore | count( (:Person)-[:WORKS_IN]->() ) AS jobs |              1 |    1 |       1 |            112 |                    0/0 |     0.159 | Fused in Pipeline 0 |
+----------------------------------+--------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 1, total allocated memory: 176

Distinct

The Distinct operator removes duplicate rows from the incoming stream of rows. To ensure only distinct elements are returned, Distinct will pull in data lazily from its source and build up state. This may lead to increased memory pressure in the system.

Example 64. Distinct
Query
MATCH (l:Location)<-[:WORKS_IN]-(p:Person)
RETURN DISTINCT l
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+----------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details                    | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+----------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | l                          |             14 |    6 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Distinct       | l                          |             14 |    6 |       0 |            224 |                        |           | Fused in Pipeline 0 |
| |               +----------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter         | p:Person                   |             15 |   15 |      15 |                |                        |           | Fused in Pipeline 0 |
| |               +----------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Expand(All)    | (l)<-[anon_0:WORKS_IN]-(p) |             15 |   15 |      16 |                |                        |           | Fused in Pipeline 0 |
| |               +----------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter         | l:Location                 |             10 |   10 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan   | l                          |             35 |   35 |      36 |            112 |                    5/0 |     0.628 | Fused in Pipeline 0 |
+-----------------+----------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 67, total allocated memory: 304

Ordered Distinct

The OrderedDistinct operator is an optimization of the Distinct operator that takes advantage of the ordering of the incoming rows. This operator has a lower memory pressure in the system than the Distinct operator.

Example 65. OrderedDistinct
Query
MATCH (p:Person)
WHERE p.name STARTS WITH 'P'
RETURN DISTINCT p.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------------+--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------+
| Operator              | Details                                                                        | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Ordered by | Other         |
+-----------------------+--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------+
| +ProduceResults       | `p.name`                                                                       |              0 |    2 |       0 |                |                    0/0 |     0.071 | p.name ASC | In Pipeline 0 |
| |                     +--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------+
| +OrderedDistinct      | cache[p.name] AS `p.name`                                                      |              0 |    2 |       0 |             32 |                    0/0 |     1.923 | p.name ASC | In Pipeline 0 |
| |                     +--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------+
| +NodeIndexSeekByRange | BTREE INDEX p:Person(name) WHERE name STARTS WITH $autostring_0, cache[p.name] |              0 |    2 |       3 |            112 |                    0/1 |     0.239 | p.name ASC | In Pipeline 0 |
+-----------------------+--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------+

Total database accesses: 3, total allocated memory: 176

Filter

The Filter operator filters each row coming from the child operator, only passing through rows that evaluate the predicates to true.

Example 66. Filter
Query
MATCH (p:Person)
WHERE p.name =~ '^a.*'
RETURN p
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details                                                          | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | p                                                                |             14 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter         | cache[p.name] =~ $autostring_0                                   |             14 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeIndexScan  | BTREE INDEX p:Person(name) WHERE name IS NOT NULL, cache[p.name] |             14 |   14 |      15 |            112 |                    0/1 |     0.373 | Fused in Pipeline 0 |
+-----------------+------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 15, total allocated memory: 176

Limit

The Limit operator returns the first n rows from the incoming input.

Example 67. Limit
Query
MATCH (p:Person)
RETURN p
LIMIT 3
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details  | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | p        |              3 |    3 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +Limit          | 3        |              3 |    3 |       0 |             32 |                        |           | Fused in Pipeline 0 |
| |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter         | p:Person |              3 |    3 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan   | p        |              8 |    4 |       5 |            112 |                    3/0 |     0.320 | Fused in Pipeline 0 |
+-----------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 5, total allocated memory: 176

Skip

The Skip operator skips n rows from the incoming rows.

Example 68. Skip
Query
MATCH (p:Person)
RETURN p
ORDER BY p.id
SKIP 1
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+----------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| Operator        | Details        | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Ordered by | Other               |
+-----------------+----------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| +ProduceResults | p              |             13 |   13 |       0 |                |                    2/0 |     0.698 | p.id ASC   | In Pipeline 1       |
| |               +----------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| +Skip           | $autoint_0     |             13 |   13 |       0 |             32 |                    0/0 |     2.206 | p.id ASC   | In Pipeline 1       |
| |               +----------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| +Sort           | `p.id` ASC     |             14 |   14 |       0 |           1800 |                    0/0 |     0.708 | p.id ASC   | In Pipeline 1       |
| |               +----------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| +Projection     | p.id AS `p.id` |             14 |   14 |       0 |                |                        |           |            | Fused in Pipeline 0 |
| |               +----------------+----------------+------+---------+----------------+                        |           +------------+---------------------+
| +Filter         | p:Person       |             14 |   14 |       0 |                |                        |           |            | Fused in Pipeline 0 |
| |               +----------------+----------------+------+---------+----------------+                        |           +------------+---------------------+
| +AllNodesScan   | p              |             35 |   35 |      36 |            112 |                    2/0 |     1.153 |            | Fused in Pipeline 0 |
+-----------------+----------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+

Total database accesses: 36, total allocated memory: 1912

Sort

The Sort operator sorts rows by a provided key. In order to sort the data, all data from the source operator needs to be pulled in eagerly and kept in the query state, which will lead to increased memory pressure in the system.

Example 69. Sort
Query
MATCH (p:Person)
RETURN p
ORDER BY p.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+--------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| Operator        | Details            | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Ordered by | Other               |
+-----------------+--------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| +ProduceResults | p                  |             14 |   14 |       0 |                |                    2/0 |     1.224 | p.name ASC | In Pipeline 1       |
| |               +--------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| +Sort           | `p.name` ASC       |             14 |   14 |       0 |           2592 |                    0/0 |     0.922 | p.name ASC | In Pipeline 1       |
| |               +--------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| +Projection     | p.name AS `p.name` |             14 |   14 |      14 |                |                        |           |            | Fused in Pipeline 0 |
| |               +--------------------+----------------+------+---------+----------------+                        |           +------------+---------------------+
| +Filter         | p:Person           |             14 |   14 |       0 |                |                        |           |            | Fused in Pipeline 0 |
| |               +--------------------+----------------+------+---------+----------------+                        |           +------------+---------------------+
| +AllNodesScan   | p                  |             35 |   35 |      36 |            112 |                    2/0 |     0.990 |            | Fused in Pipeline 0 |
+-----------------+--------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+

Total database accesses: 50, total allocated memory: 2672

Partial Sort

The PartialSort operator is an optimization of the Sort operator that takes advantage of the ordering of the incoming rows. This operator uses lazy evaluation and has a lower memory pressure in the system than the Sort operator. Partial sort is only applicable when sorting on multiple columns.

Example 70. PartialSort
Query
MATCH (p:Person)
WHERE p.name STARTS WITH 'P'
RETURN p
ORDER BY p.name, p.age
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------------+--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+-----------------------+---------------------+
| Operator              | Details                                                                        | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Ordered by            | Other               |
+-----------------------+--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+-----------------------+---------------------+
| +ProduceResults       | p                                                                              |              0 |    2 |       0 |                |                    2/0 |     0.550 | p.name ASC, p.age ASC | In Pipeline 1       |
| |                     +--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+-----------------------+---------------------+
| +PartialSort          | `p.name` ASC, `p.age` ASC                                                      |              0 |    2 |       0 |           3096 |                    0/0 |     0.535 | p.name ASC, p.age ASC | In Pipeline 1       |
| |                     +--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+-----------------------+---------------------+
| +Projection           | cache[p.name] AS `p.name`, p.age AS `p.age`                                    |              0 |    2 |       0 |                |                        |           | p.name ASC            | Fused in Pipeline 0 |
| |                     +--------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +-----------------------+---------------------+
| +NodeIndexSeekByRange | BTREE INDEX p:Person(name) WHERE name STARTS WITH $autostring_0, cache[p.name] |              0 |    2 |       3 |            112 |                    0/1 |     1.068 | p.name ASC            | Fused in Pipeline 0 |
+-----------------------+--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+-----------------------+---------------------+

Total database accesses: 3, total allocated memory: 3160

Top

The Top operator returns the first n rows sorted by a provided key. Instead of sorting the entire input, only the top n rows are retained.

Example 71. Top
Query
MATCH (p:Person)
RETURN p
ORDER BY p.name
LIMIT 2
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+----------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| Operator        | Details              | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Ordered by | Other               |
+-----------------+----------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| +ProduceResults | p                    |              2 |    2 |       0 |                |                    2/0 |     0.093 | p.name ASC | In Pipeline 1       |
| |               +----------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| +Top            | `p.name` ASC LIMIT 2 |              2 |    2 |       0 |           2584 |                    0/0 |     0.638 | p.name ASC | In Pipeline 1       |
| |               +----------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| +Projection     | p.name AS `p.name`   |             14 |   14 |      14 |                |                        |           |            | Fused in Pipeline 0 |
| |               +----------------------+----------------+------+---------+----------------+                        |           +------------+---------------------+
| +Filter         | p:Person             |             14 |   14 |       0 |                |                        |           |            | Fused in Pipeline 0 |
| |               +----------------------+----------------+------+---------+----------------+                        |           +------------+---------------------+
| +AllNodesScan   | p                    |             35 |   35 |      36 |            112 |                    2/0 |     0.173 |            | Fused in Pipeline 0 |
+-----------------+----------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+

Total database accesses: 50, total allocated memory: 2664

Partial Top

The PartialTop operator is an optimization of the Top operator that takes advantage of the ordering of the incoming rows. This operator uses lazy evaluation and has a lower memory pressure in the system than the Top operator. Partial top is only applicable when sorting on multiple columns.

Example 72. PartialTop
Query
MATCH (p:Person)
WHERE p.name STARTS WITH 'P'
RETURN p
ORDER BY p.name, p.age
LIMIT 2
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------------+--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+-----------------------+---------------------+
| Operator              | Details                                                                        | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Ordered by            | Other               |
+-----------------------+--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+-----------------------+---------------------+
| +ProduceResults       | p                                                                              |              0 |    2 |       0 |                |                    2/0 |     0.101 | p.name ASC, p.age ASC | In Pipeline 1       |
| |                     +--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+-----------------------+---------------------+
| +PartialTop           | `p.name` ASC, `p.age` ASC LIMIT 2                                              |              0 |    2 |       0 |            632 |                    0/0 |     0.650 | p.name ASC, p.age ASC | In Pipeline 1       |
| |                     +--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+-----------------------+---------------------+
| +Projection           | cache[p.name] AS `p.name`, p.age AS `p.age`                                    |              0 |    2 |       0 |                |                        |           | p.name ASC            | Fused in Pipeline 0 |
| |                     +--------------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +-----------------------+---------------------+
| +NodeIndexSeekByRange | BTREE INDEX p:Person(name) WHERE name STARTS WITH $autostring_0, cache[p.name] |              0 |    2 |       3 |            112 |                    0/1 |     0.492 | p.name ASC            | Fused in Pipeline 0 |
+-----------------------+--------------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+-----------------------+---------------------+

Total database accesses: 3, total allocated memory: 696

Union

The Union operator concatenates the results from the right child operator with the results from the left child operator.

Example 73. Union
Query
MATCH (p:Location)
  RETURN p.name
UNION ALL
MATCH (p:Country)
  RETURN p.name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+--------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details            | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+--------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults | `p.name`           |             20 |   11 |       0 |                |                        |           | Fused in Pipeline 2 |
| |               +--------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Union          |                    |             20 |   11 |       0 |           2224 |                    0/0 |     0.158 | Fused in Pipeline 2 |
| |\              +--------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| | +Projection   | `p.name`           |             10 |    1 |       0 |                |                        |           | Fused in Pipeline 1 |
| | |             +--------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Projection   | p.name AS `p.name` |             10 |    1 |       1 |                |                        |           | Fused in Pipeline 1 |
| | |             +--------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Filter       | p:Country          |             10 |    1 |       0 |                |                        |           | Fused in Pipeline 1 |
| | |             +--------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +AllNodesScan | p                  |             35 |   35 |      36 |            112 |                    0/0 |     0.106 | Fused in Pipeline 1 |
| |               +--------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Projection     | `p.name`           |             10 |   10 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +--------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Projection     | p.name AS `p.name` |             10 |   10 |      10 |                |                        |           | Fused in Pipeline 0 |
| |               +--------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter         | p:Location         |             10 |   10 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +--------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan   | p                  |             35 |   35 |      36 |            112 |                    2/0 |     0.243 | Fused in Pipeline 0 |
+-----------------+--------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 83, total allocated memory: 2424

Unwind

The Unwind operator returns one row per item in a list.

Example 74. Unwind
Query
UNWIND range(1, 5) AS value
RETURN value
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+----------------------------------------+----------------+------+---------+------------------------+-----------+---------------------+
| Operator        | Details                                | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+----------------------------------------+----------------+------+---------+------------------------+-----------+---------------------+
| +ProduceResults | value                                  |             10 |    5 |       0 |                        |           | Fused in Pipeline 0 |
| |               +----------------------------------------+----------------+------+---------+                        |           +---------------------+
| +Unwind         | range($autoint_0, $autoint_1) AS value |             10 |    5 |       0 |                    0/0 |     0.000 | Fused in Pipeline 0 |
+-----------------+----------------------------------------+----------------+------+---------+------------------------+-----------+---------------------+

Total database accesses: 0, total allocated memory: 176

Exhaustive Limit

The ExhaustiveLimit operator is just like a normal Limit but will always exhaust the input. Used when combining LIMIT and updates

Example 75. ExhaustiveLimit
Query
MATCH (p:Person)
SET p.seen = true
RETURN p
LIMIT 3
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+------------------+---------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator         | Details       | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+------------------+---------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults  | p             |              3 |    3 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                +---------------+----------------+------+---------+----------------+                        |           +---------------------+
| +ExhaustiveLimit | 3             |              3 |    3 |       0 |             32 |                        |           | Fused in Pipeline 0 |
| |                +---------------+----------------+------+---------+----------------+                        |           +---------------------+
| +SetProperty     | p.seen = true |             14 |   14 |      28 |                |                        |           | Fused in Pipeline 0 |
| |                +---------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter          | p:Person      |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                +---------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan    | p             |             35 |   35 |      36 |            112 |                    3/0 |     1.062 | Fused in Pipeline 0 |
+------------------+---------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 64, total allocated memory: 192

Optional

The Optional operator is used to solve some OPTIONAL MATCH queries. It will pull data from its source, simply passing it through if any data exists. However, if no data is returned by its source, Optional will yield a single row with all columns set to null.

Example 76. Optional
Query
MATCH (p:Person {name: 'me'})
OPTIONAL MATCH (q:Person {name: 'Lulu'})
RETURN p, q
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+------------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------+
| Operator         | Details                                               | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other         |
+------------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------+
| +ProduceResults  | p, q                                                  |              1 |    1 |       0 |                |                    2/0 |     0.097 | In Pipeline 2 |
| |                +-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------+
| +Apply           |                                                       |              1 |    1 |       0 |                |                    0/0 |     0.012 |               |
| |\               +-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------+
| | +Optional      | p                                                     |              1 |    1 |       0 |            768 |                    0/0 |     0.339 | In Pipeline 2 |
| | |              +-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------+
| | +NodeIndexSeek | BTREE INDEX q:Person(name) WHERE name = $autostring_1 |              1 |    0 |       1 |           2152 |                    1/0 |     0.483 | In Pipeline 1 |
| |                +-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------+
| +NodeIndexSeek   | BTREE INDEX p:Person(name) WHERE name = $autostring_0 |              1 |    1 |       2 |            112 |                    0/1 |     0.188 | In Pipeline 0 |
+------------------+-------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------+

Total database accesses: 3, total allocated memory: 3000

Project Endpoints

The ProjectEndpoints operator projects the start and end node of a relationship.

Example 77. ProjectEndpoints
Query
CREATE (n)-[p:KNOWS]->(m)
WITH p AS r
MATCH (u)-[r]->(v)
RETURN u, v
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+---------------------+------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator            | Details                      | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+---------------------+------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults     | u, v                         |              1 |    1 |       0 |                |                        |           | Fused in Pipeline 1 |
| |                   +------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Apply              |                              |              1 |    1 |       0 |                |                        |           |                     |
| |\                  +------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +ProjectEndpoints | (u)-[r*]->(v)                |              1 |    1 |       0 |                |                        |           | Fused in Pipeline 1 |
| | |                 +------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| | +Argument         | r                            |              1 |    1 |       0 |           4200 |                    0/0 |     0.160 | Fused in Pipeline 1 |
| |                   +------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Projection         | p AS r                       |              1 |    1 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                   +------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Create             | (n), (m), (n)-[p:KNOWS]->(m) |              1 |    1 |       4 |                |                    0/0 |     0.000 | Fused in Pipeline 0 |
+---------------------+------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 4, total allocated memory: 4280

Projection

For each incoming row, the Projection operator evaluates a set of expressions and produces a row with the results of the expressions.

Example 78. Projection
Query
RETURN 'hello' AS greeting
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+---------------------------+----------------+------+---------+------------------------+-----------+---------------------+
| Operator        | Details                   | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+---------------------------+----------------+------+---------+------------------------+-----------+---------------------+
| +ProduceResults | greeting                  |              1 |    1 |       0 |                        |           | Fused in Pipeline 0 |
| |               +---------------------------+----------------+------+---------+                        |           +---------------------+
| +Projection     | $autostring_0 AS greeting |              1 |    1 |       0 |                    0/0 |     0.000 | Fused in Pipeline 0 |
+-----------------+---------------------------+----------------+------+---------+------------------------+-----------+---------------------+

Total database accesses: 0, total allocated memory: 176

Shortest path

The ShortestPath operator finds one or all shortest paths between two previously matches node variables.

Example 79. ShortestPath
Query
MATCH
  (andy:Person {name: 'Andy'}),
  (mattias:Person {name: 'Mattias'}),
  p = shortestPath((andy)-[*]-(mattias))
RETURN p
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+---------------------+-------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------+
| Operator            | Details                                                     | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other         |
+---------------------+-------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------+
| +ProduceResults     | p                                                           |              1 |    1 |       0 |                |                    1/0 |     0.169 | In Pipeline 1 |
| |                   +-------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------+
| +ShortestPath       | p = (andy)-[anon_0*]-(mattias)                              |              1 |    1 |       1 |           3176 |                        |           | In Pipeline 1 |
| |                   +-------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------+
| +MultiNodeIndexSeek | BTREE INDEX andy:Person(name) WHERE name = $autostring_0,   |              1 |    1 |       4 |            112 |                    1/1 |     0.277 | In Pipeline 0 |
|                     | BTREE INDEX mattias:Person(name) WHERE name = $autostring_1 |                |      |         |                |                        |           |               |
+---------------------+-------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------+

Total database accesses: 5, total allocated memory: 3240

Empty Row

The EmptyRow operator returns a single row with no columns.

Example 80. EmptyRow
Query
CYPHER runtime=slotted
FOREACH (value IN [1,2,3] | MERGE (:Person {age: value}))
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+-----------------+--------------------------------------+----------------+------+---------+------------------------+
| Operator        | Details                              | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+-----------------+--------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults |                                      |              1 |    0 |       0 |                    0/0 |
| |               +--------------------------------------+----------------+------+---------+------------------------+
| +EmptyResult    |                                      |              1 |    0 |       0 |                    0/0 |
| |               +--------------------------------------+----------------+------+---------+------------------------+
| +Foreach        | value IN [1, 2, 3]                   |              1 |    1 |       0 |                    0/0 |
| |\              +--------------------------------------+----------------+------+---------+------------------------+
| | +Merge        | CREATE (anon_0:Person {age: value})  |              1 |    3 |       9 |                    0/0 |
| | |             +--------------------------------------+----------------+------+---------+------------------------+
| | +Filter       | anon_0:Person AND anon_0.age = value |              1 |    0 |     184 |                    2/0 |
| | |             +--------------------------------------+----------------+------+---------+------------------------+
| | +AllNodesScan | anon_0                               |             35 |  108 |     111 |                    3/0 |
| |               +--------------------------------------+----------------+------+---------+------------------------+
| +EmptyRow       |                                      |              1 |    1 |       0 |                    0/0 |
+-----------------+--------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 304, total allocated memory: 64

Procedure Call

The ProcedureCall operator indicates an invocation to a procedure.

Example 81. ProcedureCall
Query
CALL db.labels() YIELD label
RETURN *
ORDER BY label
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+-----------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| Operator        | Details                           | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Ordered by | Other               |
+-----------------+-----------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| +ProduceResults | label                             |             10 |    4 |       0 |                |                    0/0 |     0.062 | label ASC  | In Pipeline 1       |
| |               +-----------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| +Sort           | label ASC                         |             10 |    4 |       0 |           1064 |                    0/0 |     0.177 | label ASC  | In Pipeline 1       |
| |               +-----------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+
| +ProcedureCall  | db.labels() :: (label :: STRING?) |             10 |    4 |         |                |                        |           |            | Fused in Pipeline 0 |
+-----------------+-----------------------------------+----------------+------+---------+----------------+------------------------+-----------+------------+---------------------+

Total database accesses: ?, total allocated memory: 1128

Cache Properties

The CacheProperties operator reads nodes and relationship properties and caches them in the current row. Future accesses to these properties can avoid reading from the store which will speed up the query. In the plan below we will cache l.name before Expand(All) where there are fewer rows.

Example 82. CacheProperties
Query
MATCH (l:Location)<-[:WORKS_IN]-(p:Person)
RETURN
  l.name AS location,
  p.name AS name
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+------------------+-------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator         | Details                                   | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+------------------+-------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults  | location, name                            |             15 |   15 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                +-------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Projection      | cache[l.name] AS location, p.name AS name |             15 |   15 |      30 |                |                        |           | Fused in Pipeline 0 |
| |                +-------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter          | p:Person                                  |             15 |   15 |      15 |                |                        |           | Fused in Pipeline 0 |
| |                +-------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Expand(All)     | (l)<-[anon_0:WORKS_IN]-(p)                |             15 |   15 |      16 |                |                        |           | Fused in Pipeline 0 |
| |                +-------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +CacheProperties | cache[l.name]                             |             10 |   10 |      10 |                |                        |           | Fused in Pipeline 0 |
| |                +-------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter          | l:Location                                |             10 |   10 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                +-------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan    | l                                         |             35 |   35 |      36 |            112 |                    4/0 |     0.410 | Fused in Pipeline 0 |
+------------------+-------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 107, total allocated memory: 192

Create (nodes and relationships)

The Create operator is used to create nodes and relationships.

Example 83. Create
Query
CREATE
  (max:Person {name: 'Max'}),
  (chris:Person {name: 'Chris'})
CREATE (max)-[:FRIENDS_WITH]->(chris)
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+---------------------------------------------------------------------------+----------------+------+---------+------------------------+-----------+---------------------+
| Operator        | Details                                                                   | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+---------------------------------------------------------------------------+----------------+------+---------+------------------------+-----------+---------------------+
| +ProduceResults |                                                                           |              1 |    0 |       0 |                        |           | Fused in Pipeline 0 |
| |               +---------------------------------------------------------------------------+----------------+------+---------+                        |           +---------------------+
| +EmptyResult    |                                                                           |              1 |    0 |       0 |                        |           | Fused in Pipeline 0 |
| |               +---------------------------------------------------------------------------+----------------+------+---------+                        |           +---------------------+
| +Create         | (max:Person {name: $autostring_0}), (chris:Person {name: $autostring_1}), |              1 |    1 |       7 |                    0/0 |     0.000 | Fused in Pipeline 0 |
|                 | (max)-[anon_0:FRIENDS_WITH]->(chris)                                      |                |      |         |                        |           |                     |
+-----------------+---------------------------------------------------------------------------+----------------+------+---------+------------------------+-----------+---------------------+

Total database accesses: 7, total allocated memory: 176

Delete (nodes and relationships)

The Delete operator is used to delete a node or a relationship.

Example 84. Delete
Query
MATCH (me:Person {name: 'me'})-[w:WORKS_IN {duration: 190}]->(london:Location {name: 'London'})
DELETE w
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+-----------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details                                                                     | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+-----------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults |                                                                             |              0 |    0 |       0 |                |                        |           | Fused in Pipeline 1 |
| |               +-----------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +EmptyResult    |                                                                             |              0 |    0 |       0 |                |                        |           | Fused in Pipeline 1 |
| |               +-----------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Delete         | w                                                                           |              0 |    1 |       1 |                |                        |           | Fused in Pipeline 1 |
| |               +-----------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Eager          | delete overlap: w                                                           |              0 |    1 |       0 |           3192 |                    1/0 |     0.215 | Fused in Pipeline 1 |
| |               +-----------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +Filter         | london.name = $autostring_2 AND w.duration = $autoint_1 AND london:Location |              0 |    1 |       4 |                |                        |           | Fused in Pipeline 0 |
| |               +-----------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Expand(All)    | (me)-[w:WORKS_IN]->(london)                                                 |              1 |    1 |       3 |                |                        |           | Fused in Pipeline 0 |
| |               +-----------------------------------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +NodeIndexSeek  | BTREE INDEX me:Person(name) WHERE name = $autostring_0                      |              1 |    1 |       2 |            112 |                    4/1 |     0.442 | Fused in Pipeline 0 |
+-----------------+-----------------------------------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 10, total allocated memory: 3272

Detach Delete

The DetachDelete operator is used in all queries containing the DETACH DELETE clause, when deleting nodes and their relationships.

Example 85. DetachDelete
Query
MATCH (p:Person)
DETACH DELETE p
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details  | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults |          |             14 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +EmptyResult    |          |             14 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +DetachDelete   | p        |             14 |   14 |      31 |                |                        |           | Fused in Pipeline 0 |
| |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +Filter         | p:Person |             14 |   14 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan   | p        |             35 |   35 |      36 |            112 |                   19/0 |     1.332 | Fused in Pipeline 0 |
+-----------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 67, total allocated memory: 192

Set Labels

The SetLabels operator is used when setting labels on a node.

Example 86. SetLabels
Query
MATCH (n)
SET n:Person
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details  | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults |          |             35 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +EmptyResult    |          |             35 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +SetLabels      | n:Person |             35 |   35 |      22 |                |                        |           | Fused in Pipeline 0 |
| |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan   | n        |             35 |   35 |      36 |            112 |                    3/0 |     1.188 | Fused in Pipeline 0 |
+-----------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 58, total allocated memory: 176

Remove Labels

The RemoveLabels operator is used when deleting labels from a node.

Example 87. RemoveLabels
Query
MATCH (n)
REMOVE n:Person
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details  | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults |          |             35 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +EmptyResult    |          |             35 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +RemoveLabels   | n:Person |             35 |   35 |      15 |                |                        |           | Fused in Pipeline 0 |
| |               +----------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan   | n        |             35 |   35 |      36 |            112 |                    3/0 |     2.081 | Fused in Pipeline 0 |
+-----------------+----------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 51, total allocated memory: 176

Set Node Properties From Map

The SetNodePropertiesFromMap operator is used when setting properties from a map on a node.

Example 88. SetNodePropertiesFromMap
Query
MATCH (n)
SET n = {weekday: 'Monday', meal: 'Lunch'}
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+---------------------------+---------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                  | Details                                           | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+---------------------------+---------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults           |                                                   |             35 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                         +---------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +EmptyResult              |                                                   |             35 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                         +---------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +SetNodePropertiesFromMap | n = {weekday: $autostring_0, meal: $autostring_1} |             35 |   35 |     105 |                |                        |           | Fused in Pipeline 0 |
| |                         +---------------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan             | n                                                 |             35 |   35 |      36 |            112 |                    5/0 |     3.873 | Fused in Pipeline 0 |
+---------------------------+---------------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 141, total allocated memory: 176

Set Relationship Properties From Map

The SetRelationshipPropertiesFromMap operator is used when setting properties from a map on a relationship.

Example 89. SetRelationshipPropertiesFromMap
Query
MATCH (n)-[r]->(m)
SET r = {weight: 5, unit: 'kg'}
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------------------------+-----------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator                          | Details                                       | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------------------------+-----------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults                   |                                               |             18 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                                 +-----------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +EmptyResult                      |                                               |             18 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |                                 +-----------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +SetRelationshipPropertiesFromMap | r = {weight: $autoint_0, unit: $autostring_1} |             18 |   18 |      54 |                |                        |           | Fused in Pipeline 0 |
| |                                 +-----------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +Expand(All)                      | (m)<-[r]-(n)                                  |             18 |   18 |      36 |                |                        |           | Fused in Pipeline 0 |
| |                                 +-----------------------------------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan                     | m                                             |             35 |   35 |      36 |            112 |                    6/0 |     4.009 | Fused in Pipeline 0 |
+-----------------------------------+-----------------------------------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 126, total allocated memory: 192

Set Property

The SetProperty operator is used when setting a property on a node or relationship.

Example 90. SetProperty
Query
MATCH (n)
SET n.checked = true
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime PIPELINED

Runtime version 4.4

+-----------------+------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| Operator        | Details          | Estimated Rows | Rows | DB Hits | Memory (Bytes) | Page Cache Hits/Misses | Time (ms) | Other               |
+-----------------+------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+
| +ProduceResults |                  |             35 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +EmptyResult    |                  |             35 |    0 |       0 |                |                        |           | Fused in Pipeline 0 |
| |               +------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +SetProperty    | n.checked = true |             35 |   35 |      70 |                |                        |           | Fused in Pipeline 0 |
| |               +------------------+----------------+------+---------+----------------+                        |           +---------------------+
| +AllNodesScan   | n                |             35 |   35 |      36 |            112 |                    3/0 |     0.529 | Fused in Pipeline 0 |
+-----------------+------------------+----------------+------+---------+----------------+------------------------+-----------+---------------------+

Total database accesses: 106, total allocated memory: 176

Create Unique Constraint

The CreateUniqueConstraint operator creates a unique constraint on a set of properties for all nodes having a certain label. The following query will create a unique constraint with the name uniqueness on the name property of nodes with the Country label.

Example 91. CreateUniqueConstraint
Query
CREATE CONSTRAINT uniqueness
FOR (c:Country) REQUIRE c.name is UNIQUE
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+-------------------+------------------------------------------------------------------+
| Operator          | Details                                                          |
+-------------------+------------------------------------------------------------------+
| +CreateConstraint | CONSTRAINT uniqueness FOR (c:Country) REQUIRE (c.name) IS UNIQUE |
+-------------------+------------------------------------------------------------------+

Total database accesses: ?

Drop Unique Constraint

The DropUniqueConstraint operator removes a unique constraint from all nodes having a certain set of properties and label. The following query will drop a unique constraint on the name property of nodes with the Country label.

Example 92. DropUniqueConstraint
Query
DROP CONSTRAINT ON (c:Country) ASSERT c.name is UNIQUE
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+-----------------+-----------------------------------------------------+
| Operator        | Details                                             |
+-----------------+-----------------------------------------------------+
| +DropConstraint | CONSTRAINT ON (c:Country) ASSERT (c.name) IS UNIQUE |
+-----------------+-----------------------------------------------------+

Total database accesses: ?

Do Nothing If Exists (constraint)

To not get an error creating the same constraint twice, we use the DoNothingIfExists operator for constraints. This will make sure no other constraint with the given name or another constraint of the same type and schema already exists before the specific CreateConstraint operator creates the constraint. If it finds a constraint with the given name or with the same type and schema it will stop the execution and no new constraint is created. The following query will create a unique constraint with the name uniqueness on the name property of nodes with the Country label only if no constraint named uniqueness or unique constraint on (:Country {name}) already exists.

Example 93. DoNothingIfExists(CONSTRAINT)
Query
CREATE CONSTRAINT uniqueness IF NOT EXISTS
FOR (c:Country) REQUIRE c.name is UNIQUE
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+--------------------------------+------------------------------------------------------------------+
| Operator                       | Details                                                          |
+--------------------------------+------------------------------------------------------------------+
| +CreateConstraint              | CONSTRAINT uniqueness FOR (c:Country) REQUIRE (c.name) IS UNIQUE |
| |                              +------------------------------------------------------------------+
| +DoNothingIfExists(CONSTRAINT) | CONSTRAINT uniqueness FOR (c:Country) REQUIRE (c.name) IS UNIQUE |
+--------------------------------+------------------------------------------------------------------+

Total database accesses: ?

Create Node Property Existence Constraint

The CreateNodePropertyExistenceConstraint operator creates an existence constraint with the name existence on a property for all nodes having a certain label. This will only appear in Enterprise Edition.

Example 94. CreateNodePropertyExistenceConstraint
Query
CREATE CONSTRAINT existence
FOR (p:Person) REQUIRE p.name IS NOT NULL
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+-------------------+------------------------------------------------------------------+
| Operator          | Details                                                          |
+-------------------+------------------------------------------------------------------+
| +CreateConstraint | CONSTRAINT existence FOR (p:Person) REQUIRE (p.name) IS NOT NULL |
+-------------------+------------------------------------------------------------------+

Total database accesses: ?

Drop Node Property Existence Constraint

The DropNodePropertyExistenceConstraint operator removes an existence constraint from a property for all nodes having a certain label. This will only appear in Enterprise Edition.

Example 95. DropNodePropertyExistenceConstraint
Query
DROP CONSTRAINT ON (p:Person) ASSERT exists(p.name)
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+-----------------+------------------------------------------------+
| Operator        | Details                                        |
+-----------------+------------------------------------------------+
| +DropConstraint | CONSTRAINT ON (p:Person) ASSERT exists(p.name) |
+-----------------+------------------------------------------------+

Total database accesses: ?

Create Node Key Constraint

The CreateNodeKeyConstraint operator creates a node key constraint with the name node_key which ensures that all nodes with a particular label have a set of defined properties whose combined value is unique, and where all properties in the set are present. This will only appear in Enterprise Edition.

Example 96. CreateNodeKeyConstraint
Query
CREATE CONSTRAINT node_key
FOR (e:Employee) REQUIRE (e.firstname, e.surname) IS NODE KEY
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+-------------------+-----------------------------------------------------------------------------------+
| Operator          | Details                                                                           |
+-------------------+-----------------------------------------------------------------------------------+
| +CreateConstraint | CONSTRAINT node_key FOR (e:Employee) REQUIRE (e.firstname, e.surname) IS NODE KEY |
+-------------------+-----------------------------------------------------------------------------------+

Total database accesses: ?

Drop Node Key Constraint

The DropNodeKeyConstraint operator removes a node key constraint from a set of properties for all nodes having a certain label. This will only appear in Enterprise Edition.

Example 97. DropNodeKeyConstraint
Query
DROP CONSTRAINT ON (e:Employee) ASSERT (e.firstname, e.surname) IS NODE KEY
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+-----------------+------------------------------------------------------------------------+
| Operator        | Details                                                                |
+-----------------+------------------------------------------------------------------------+
| +DropConstraint | CONSTRAINT ON (e:Employee) ASSERT (e.firstname, e.surname) IS NODE KEY |
+-----------------+------------------------------------------------------------------------+

Total database accesses: ?

Create Relationship Property Existence Constraint

The CreateRelationshipPropertyExistenceConstraint operator creates an existence constraint with the name existence on a property for all relationships of a certain type. This will only appear in Enterprise Edition.

Example 98. CreateRelationshipPropertyExistenceConstraint
Query
CREATE CONSTRAINT existence
FOR ()-[l:LIKED]-() REQUIRE l.when IS NOT NULL
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+-------------------+-----------------------------------------------------------------------+
| Operator          | Details                                                               |
+-------------------+-----------------------------------------------------------------------+
| +CreateConstraint | CONSTRAINT existence FOR ()-[l:LIKED]-() REQUIRE (l.when) IS NOT NULL |
+-------------------+-----------------------------------------------------------------------+

Total database accesses: ?

Drop Relationship Property Existence Constraint

The DropRelationshipPropertyExistenceConstraint operator removes an existence constraint from a property for all relationships of a certain type. This will only appear in Enterprise Edition.

Example 99. DropRelationshipPropertyExistenceConstraint
Query
DROP CONSTRAINT ON ()-[l:LIKED]-() ASSERT exists(l.when)
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+-----------------+-----------------------------------------------------+
| Operator        | Details                                             |
+-----------------+-----------------------------------------------------+
| +DropConstraint | CONSTRAINT ON ()-[l:LIKED]-() ASSERT exists(l.when) |
+-----------------+-----------------------------------------------------+

Total database accesses: ?

Drop Constraint

The DropConstraint operator removes a constraint using the name of the constraint, no matter the type.

Example 100. DropConstraint
Query
DROP CONSTRAINT name
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+-----------------+-----------------+
| Operator        | Details         |
+-----------------+-----------------+
| +DropConstraint | CONSTRAINT name |
+-----------------+-----------------+

Total database accesses: ?

Show Constraints

The ShowConstraints operator lists constraints. It may include filtering on constraint type and can have either default or full output.

Example 101. ShowConstraints
Query
SHOW CONSTRAINTS
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+------------------+---------------------------------------------------------------------+----------------+------+---------+------------------------+
| Operator         | Details                                                             | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+------------------+---------------------------------------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults  | id, name, type, entityType, labelsOrTypes, properties, ownedIndexId |             10 |    3 |       0 |                    0/0 |
| |                +---------------------------------------------------------------------+----------------+------+---------+------------------------+
| +ShowConstraints | allConstraints, defaultColumns                                      |             10 |    3 |       1 |                    0/0 |
+------------------+---------------------------------------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 1, total allocated memory: 64

Create Index

The CreateIndex operator creates an index. This index can either be a b-tree, fulltext, text, or token lookup index. The following query will create an index with the name my_index on the name property of nodes with the Country label.

Example 102. CreateIndex
Query
CREATE INDEX my_index
FOR (c:Country) ON (c.name)
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+--------------+-----------------------------------------------+
| Operator     | Details                                       |
+--------------+-----------------------------------------------+
| +CreateIndex | BTREE INDEX my_index FOR (:Country) ON (name) |
+--------------+-----------------------------------------------+

Total database accesses: ?

Do Nothing If Exits (index)

To not get an error creating the same index twice, we use the DoNothingIfExists operator for indexes. This will make sure no other index with the given name or schema already exists before the CreateIndex operator creates an index. If it finds an index with the given name or schema it will stop the execution and no new index is created. The following query will create an index with the name my_index on the since property of relationships with the KNOWS relationship type only if no such index already exists.

Example 103. DoNothingIfExists(INDEX)
Query
CREATE INDEX my_index IF NOT EXISTS
FOR ()-[k:KNOWS]-() ON (k.since)
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+---------------------------+----------------------------------------------------+
| Operator                  | Details                                            |
+---------------------------+----------------------------------------------------+
| +CreateIndex              | BTREE INDEX my_index FOR ()-[:KNOWS]-() ON (since) |
| |                         +----------------------------------------------------+
| +DoNothingIfExists(INDEX) | BTREE INDEX my_index FOR ()-[:KNOWS]-() ON (since) |
+---------------------------+----------------------------------------------------+

Total database accesses: ?

Drop Index by schema

The DropIndex operator removes an index from a property for all nodes having a certain label.

Example 104. DropIndex

The following query will drop an index on the name property of nodes with the Country label.

Query
DROP INDEX ON :Country(name)
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+------------+--------------------------------------+
| Operator   | Details                              |
+------------+--------------------------------------+
| +DropIndex | BTREE INDEX FOR (:Country) ON (name) |
+------------+--------------------------------------+

Total database accesses: ?

Drop Index

The DropIndex operator removes an index using the name of the index.

Example 105. DropIndex
Query
DROP INDEX name
Query Plan
Compiler CYPHER 4.4

Planner ADMINISTRATION

Runtime SCHEMA

Runtime version 4.4

+------------+------------+
| Operator   | Details    |
+------------+------------+
| +DropIndex | INDEX name |
+------------+------------+

Total database accesses: ?

Show Indexes

The ShowIndexes operator lists indexes. It may include filtering on index type and can have either default or full output.

Example 106. ShowIndexes
Query
SHOW INDEXES
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+-----------------+----------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+
| Operator        | Details                                                                                      | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+-----------------+----------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults | id, name, state, populationPercent, uniqueness, type, entityType, labelsOrTypes, properties, |             10 |    7 |       0 |                    0/0 |
| |               | indexProvider                                                                                |                |      |         |                        |
| |               +----------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+
| +ShowIndexes    | allIndexes, defaultColumns                                                                   |             10 |    7 |       1 |                    0/0 |
+-----------------+----------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 1, total allocated memory: 64

Show Functions

The ShowFunctions operator lists functions. It may include filtering on built-in vs user-defined functions as well as if a given user can execute the function. The output can either be default or full output.

Example 107. ShowFunctions
Query
SHOW FUNCTIONS
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+-----------------+-----------------------------------------------------+----------------+------+---------+------------------------+
| Operator        | Details                                             | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+-----------------+-----------------------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults | name, category, description                         |             10 |  143 |       0 |                    0/0 |
| |               +-----------------------------------------------------+----------------+------+---------+------------------------+
| +ShowFunctions  | allFunctions, functionsForUser(all), defaultColumns |             10 |  143 |       0 |                    0/0 |
+-----------------+-----------------------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 0, total allocated memory: 64

Show Procedures

The ShowProcedures operator lists procedures. It may include filtering on whether a given user can execute the procedure and can have either default or full output.

Example 108. ShowProcedures
Query
SHOW PROCEDURES
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+-----------------+----------------------------------------+----------------+------+---------+------------------------+
| Operator        | Details                                | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+-----------------+----------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults | name, description, mode, worksOnSystem |             10 |   73 |       0 |                    0/0 |
| |               +----------------------------------------+----------------+------+---------+------------------------+
| +ShowProcedures | proceduresForUser(all), defaultColumns |             10 |   73 |       0 |                    0/0 |
+-----------------+----------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 0, total allocated memory: 64

Show Transactions

The ShowTransactions operator lists transactions. It may include filtering on given ids and can have either default or full output.

Example 109. ShowTransactions
Query
SHOW TRANSACTIONS
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+-------------------+-----------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+
| Operator          | Details                                                                                       | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+-------------------+-----------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults   | database, transactionId, currentQueryId, connectionId, clientAddress, username, currentQuery, |             10 |    1 |       0 |                    0/0 |
| |                 | startTime, status, elapsedTime, allocatedBytes                                                |                |      |         |                        |
| |                 +-----------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+
| +ShowTransactions | defaultColumns, allTransactions                                                               |             10 |    1 |       0 |                    0/0 |
+-------------------+-----------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 0, total allocated memory: 64

Terminate Transactions

The TerminateTransactions operator terminates transactions by ID.

Example 110. TerminateTransactions
Query
TERMINATE TRANSACTIONS 'database-transaction-123'
Query Plan
Compiler CYPHER 4.4

Planner COST

Runtime SLOTTED

Runtime version 4.4

+------------------------+----------------------------------------+----------------+------+---------+------------------------+
| Operator               | Details                                | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses |
+------------------------+----------------------------------------+----------------+------+---------+------------------------+
| +ProduceResults        | transactionId, username, message       |             10 |    1 |       0 |                    0/0 |
| |                      +----------------------------------------+----------------+------+---------+------------------------+
| +TerminateTransactions | transactions: database-transaction-123 |             10 |    1 |       0 |                    0/0 |
+------------------------+----------------------------------------+----------------+------+---------+------------------------+

Total database accesses: 0, total allocated memory: 64