3.7.5. Update operators

These operators are used in queries that update the graph.

Operators:

3.7.5.1. Create Node

Creates a node in the graph.

Query. 

CREATE (:Person { name: 'Alistair' })

Query Plan. 

Compiler CYPHER 3.3

Planner COST

Runtime INTERPRETED

+-----------------+----------------+------+---------+-----------------+-------------------+----------------------+-----------+
| Operator        | Estimated Rows | Rows | DB Hits | Page Cache Hits | Page Cache Misses | Page Cache Hit Ratio | Variables |
+-----------------+----------------+------+---------+-----------------+-------------------+----------------------+-----------+
| +ProduceResults |              1 |    0 |       0 |               0 |                 0 |               0.0000 | anon[8]   |
| |               +----------------+------+---------+-----------------+-------------------+----------------------+-----------+
| +EmptyResult    |              1 |    0 |       0 |               1 |                 0 |               1.0000 | anon[8]   |
| |               +----------------+------+---------+-----------------+-------------------+----------------------+-----------+
| +CreateNode     |              1 |    1 |       4 |               1 |                 0 |               1.0000 | anon[8]   |
+-----------------+----------------+------+---------+-----------------+-------------------+----------------------+-----------+

Total database accesses: 4

3.7.5.2. Constraint Operation

Creates a constraint on a (label,property) pair. The following query will create a unique constraint on the name property of nodes with the Country label.

Query. 

CREATE CONSTRAINT ON (c:Country) ASSERT c.name IS UNIQUE

Query Plan. 

Compiler CYPHER 3.3

Planner PROCEDURE

Runtime PROCEDURE

+-------------------------+
| Operator                |
+-------------------------+
| +CreateUniqueConstraint |
+-------------------------+

Total database accesses: ?

3.7.5.3. Empty Result

Eagerly loads everything coming in to the EmptyResult operator and discards it.

Query. 

CREATE (:Person)

Query Plan. 

Compiler CYPHER 3.3

Planner COST

Runtime INTERPRETED

+-----------------+----------------+------+---------+-----------------+-------------------+----------------------+-----------+
| Operator        | Estimated Rows | Rows | DB Hits | Page Cache Hits | Page Cache Misses | Page Cache Hit Ratio | Variables |
+-----------------+----------------+------+---------+-----------------+-------------------+----------------------+-----------+
| +ProduceResults |              1 |    0 |       0 |               0 |                 0 |               0.0000 | anon[8]   |
| |               +----------------+------+---------+-----------------+-------------------+----------------------+-----------+
| +EmptyResult    |              1 |    0 |       0 |               1 |                 0 |               1.0000 | anon[8]   |
| |               +----------------+------+---------+-----------------+-------------------+----------------------+-----------+
| +CreateNode     |              1 |    1 |       2 |               1 |                 0 |               1.0000 | anon[8]   |
+-----------------+----------------+------+---------+-----------------+-------------------+----------------------+-----------+

Total database accesses: 2