List of all notification codes

The following are all Neo4j notifications, grouped by category, when they are returned, and an example of improvement.

PERFORMANCE category

Performance notifications are returned whenever the query uses costly operations and the performance may be improved by changing the query or adding an index.

CartesianProduct

When is this notification returned?

Whenever there is a cartesian product in the plan.

Table 1. Notification details

Code

Neo.ClientNotification.Statement.CartesianProduct

Title

This query builds a cartesian product between disconnected patterns.

Severity

INFORMATION

Category

PERFORMANCE

Example 1. Cartesian product
Query
MATCH (c:Child), (p:Parent) RETURN c, p
Description of the returned code

If a part of a query contains multiple disconnected patterns, this will build a cartesian product between all those parts. This may produce a large amount of data and slow down query processing. While occasionally intended, it may often be possible to reformulate the query that avoids the use of this cross product, perhaps by adding a relationship between the different parts or by using OPTIONAL MATCH (identifier is: (p))

Suggestions for improvement

In case a cartesian product is needed, nothing can be done to improve this query. In many cases, however, you might not need a combination of all children and parents, and that is when this query could be improved. If for example, you need the children and the children’s parents, you can improve this query by rewriting it to the following:

MATCH (c:Child)-[:ChildOf]->(p:Parent) RETURN c, p

UnboundedVariableLengthPattern

When is this notification returned?

When there is no upper bound specified on the variable length relationship.

Table 2. Notification details

Code

Neo.ClientNotification.Statement.UnboundedVariableLengthPattern

Title

The provided pattern is unbounded, consider adding an upper limit to the number of node hops.

Severity

INFORMATION

Category

PERFORMANCE

Example 2. Shortest path with an unbounded pattern
Query
MATCH p=shortestPath((n)-[*]->(m)) RETURN p
Description of the returned code

Using shortest path with an unbounded pattern will likely result in long execution times. It is recommended to use an upper limit to the number of node hops in your pattern.

Suggestions for improvement

If you have a big graph, this query might be very slow. Consider adding an upper limit.

MATCH p=shortestPath((n)-[*..8]->(m)) RETURN p

ExhaustiveShortestPath

When is this notification returned?

When a predicate, given on the shortest path, needs to inspect the whole path before deciding whether it is valid, the shortest path might fall back to the exhaustive search algorithm. For more information, see Cypher manual → Shortest path planning.

Table 3. Notification details

Code

Neo.ClientNotification.Statement.ExhaustiveShortestPath

Title

Exhaustive shortest path has been planned for your query that means that shortest path graph algorithm might not be used to find the shortest path. Hence an exhaustive enumeration of all paths might be used in order to find the requested shortest path.

Severity

INFORMATION

Category

PERFORMANCE

Example 3. Exhaustive shortest path
MATCH p = shortestPath(()-[*..42]-())
WHERE ANY(n in nodes(p) WHERE n:Label)
RETURN p
Description of the returned code

Using shortest path with an exhaustive search fallback might cause query slow down since shortest path graph algorithms might not work for this use case. It is recommended to introduce a WITH to separate the MATCH containing the shortest path from the existential predicates on that path.

Suggestions for improvement

Separate the predicate by introducing a WITH after the MATCH clause.

MATCH p = shortestPath(()-[*..42]-())
WITH p
WHERE ANY(n in nodes(p) WHERE n:Label)
RETURN p

NoApplicableIndex

When is this notification returned?

Given a larger number of nodes, LOAD CSV together with a MATCH or a MERGE clause may speed up the query if you add an index.

Table 4. Notification details

Code

Neo.ClientNotification.Statement.NoApplicableIndex

Title

Adding a schema index may speed up this query.

Severity

INFORMATION

Category

PERFORMANCE

Example 4. Load CSV with MATCH or MERGE
Query
LOAD CSV FROM 'file:///ignore/ignore.csv' AS line WITH * MATCH (n:Person{name:line[0]}) RETURN line, n
Description of the returned code

Using LOAD CSV followed by a MATCH or MERGE that matches a non-indexed label will most likely not perform well on large data sets. Please consider using a schema index.

Suggestions for improvement

Create an index on the label and property you match.

CREATE INDEX FOR (n:Person) ON (n.name)

EagerOperator

When is this notification returned?

When the execution plan for a query contains an eager operator.

Table 5. Notification details

Code

Neo.ClientNotification.Statement.EagerOperator

Title

The execution plan for this query contains the Eager operator, which forces all dependent data to be materialized in main memory before proceeding

Severity

INFORMATION

Category

PERFORMANCE

Example 5. Load CSV with MATCH or MERGE

LOAD CSV together with an Eager operator can take up a lot of memory.

Query
LOAD CSV FROM 'file:///ignore/ignore.csv' AS line MATCH (n:Person{name:line[0]}) DELETE n RETURN line
Description of the returned code

Using LOAD CSV with a large data set in a query where the execution plan contains the Eager operator could potentially consume a lot of memory and is likely to not perform well. See the Neo4j Manual entry on the Eager operator for more information and hints on how problems could be avoided.

Suggestions for improvement

See the Cypher Manual → Eager operator for more information and hints on how to avoid problems. In this specific case, the query could be rewritten to the following:

LOAD CSV FROM 'file:///ignore/ignore.csv' AS line
CALL {
    WITH line
    MATCH (n:Person{name:line[0]}) DELETE n
}
RETURN line

DynamicProperty

Table 6. Notification details

Code

Neo.ClientNotification.Statement.DynamicProperty

Title

Queries using dynamic properties will use neither index seeks nor index scans for those properties

Severity

INFORMATION

Category

PERFORMANCE

Example 6. Using a dynamic node property key makes it impossible to use indexes
Query
MATCH (n:Person) WHERE n[$prop] IS NOT NULL RETURN n;
Description of the returned code

Did not supply query with enough parameters. The produced query plan will not be cached and is not executable without EXPLAIN. (Missing parameters: prop)

Suggestions for improvement

If there is an index for (n:Person) ON (n.name), it will not be used for the above query because the query is using a dynamic property. Therefore, if there is an index, it is better to use the constant value. For example, if prop is equal to name, the following query would be able to use the index:

MATCH (n:Person) WHERE n.name IS NOT NULL RETURN n;
Example 7. Using dynamic relationship property key makes it impossible to use indexes
Query
MATCH ()-[r: KNOWS]->() WHERE r[$prop] IS NOT NULL RETURN r
Description of the returned code

Did not supply query with enough parameters. The produced query plan will not be cached and is not executable without EXPLAIN. (Missing parameters: prop)

Suggestions for improvement

Similar to dynamic node properties, use a constant value if possible, especially when there is an index on the relationship property. For example, if $prop is equal to since, you can rewrite the query to:

MATCH ()-[r: KNOWS]->() WHERE r.since IS NOT NULL RETURN r

CodeGenerationFailed

Table 7. Notification details

Code

Neo.ClientNotification.Statement.CodeGenerationFailed

Title

The database was unable to generate code for the query. A stack trace can be found in the debug.log.

Severity

INFORMATION

Category

PERFORMANCE

The CodeGenerationFailed notification is created when it is not possible to generate a code for a query, for example, when the query is too big. To find more information about the specific query, see the stack trace in the debug.log file.

HINT category

HINT notifications are returned by default when the Cypher planner or runtime cannot create a query plan to fulfill a specified hint, for example, JOIN or INDEX. This behavior of the Cypher planner or runtime can be changed by setting the configuration dbms.cypher.hints_error to true, in which case, the query will return an error instead.

JoinHintUnfulfillableWarning

Table 8. Notification details

Code

Neo.ClientNotification.Statement.JoinHintUnfulfillableWarning

Title

The database was unable to plan a hinted join.

Severity

WARNING

Category

HINT

Example 8. A JOIN hint was given, but it was not possible to fulfill the hint.
Query
MATCH (a:A)
WITH a, 1 AS horizon
OPTIONAL MATCH (a)-[r]->(b:B)
USING JOIN ON a
OPTIONAL MATCH (a)--(c)
RETURN *
Description of the returned code

The hinted join was not planned. This could happen because no generated plan contained the join key, please try using a different join key or restructure your query. (hinted join key identifier is: a)

Suggestions for improvement

The join hint cannot be fulfilled because the given JOIN variable was introduced before the optional match and is therefore already bound. The only option for this query is to remove the hint or change the query so it is possible to use the hint.

HintedIndexNotFound

Table 9. Notification details

Code

Neo.ClientNotification.Schema.HintedIndexNotFound

Title

The request (directly or indirectly) referred to an index that does not exist.

Severity

WARNING

Category

HINT

Example 9. An index hint was given, but it was not possible to use the index.
Query
MATCH (a: Label)
USING INDEX a:Label(id)
WHERE a.id = 1
RETURN a
Description of the returned code

The hinted index does not exist, please check the schema (index is: INDEX FOR (a:`Label`) ON (a.id))

Suggestions for improvement

The hinted index does not exist, make sure the label and property are spelled correctly. If the spelling is correct, either create the index or remove the hint from the query.

Example 10. A relationship index hint was given, but it was not possible to use the index
Query
MATCH ()-[r:Rel]-()
USING INDEX r:Rel(id)
WHERE r.id = 1
RETURN r
Description of the returned code

The hinted index does not exist, please check the schema (index is: INDEX FOR ()-[r:`Rel`]-() ON (r.id))

Suggestions for improvement

The hinted index does not exist, make sure the label and property are spelled correctly. If the spelling is correct, either create the index or remove the hint from the query.

UNRECOGNIZED category

A notification has the unrecognized category if the query or command mentions entities that are unknown to the system.

HomeDatabaseNotFound

Table 10. Notification details

Code

Neo.ClientNotification.Database.HomeDatabaseNotFound

Title

The request referred to a home database that does not exist.

Severity

INFORMATION

Category

UNRECOGNIZED

Example 11. Set the home database to a database that does not yet exist.
Query
CREATE USER linnea SET PASSWORD "password" SET HOME DATABASE NonExistingDatabase
Description of the returned code

The home database provided does not currently exist in the DBMS. This command will not take effect until this database is created. (HOME DATABASE: nonexistingdatabase)

Suggestions for improvement

Make sure the home database has not been misspelled.

UnknownLabelWarning

Table 11. Notification details

Code

Neo.ClientNotification.Statement.UnknownLabelWarning

Title

The provided label is not in the database.

Severity

WARNING

Category

UNRECOGNIZED

Example 12. Match on a node with a label that does not exist in the database.
Query
MATCH (n:Perso) RETURN n
Description of the returned code

One of the labels in your query is not available in the database, make sure you didn’t misspell it or that the label is available when you run this statement in your application (the missing label name is: Perso)

Suggestions for improvement

Make sure you didn’t misspell the label. If nodes with the given label will be created in the future, then no change is needed.

UnknownRelationshipTypeWarning

Table 12. Notification details

Code

Neo.ClientNotification.Statement.UnknownRelationshipTypeWarning

Title

The provided relationship type is not in the database.

Severity

WARNING

Category

UNRECOGNIZED

Example 13. Match on a relationship, where there are no relationships in the database with the given relationship type.
Query
MATCH (n)-[:NonExistingType]->() RETURN n
Description of the returned code

One of the relationship types in your query is not available in the database, make sure you didn’t misspell it or that the label is available when you run this statement in your application (the missing relationship type is: NonExistingType)

Suggestions for improvement

Make sure you did not misspell the relationship type. If relationships will be created, with the given relationship type, in the future, then no change to the query is needed.

UnknownPropertyKeyWarning

Table 13. Notification details

Code

Neo.ClientNotification.Statement.UnknownPropertyKeyWarning

Title

The provided property key is not in the database

Severity

WARNING

Category

UNRECOGNIZED

Example 14. Match on a property key that does not exist.
Query
MATCH (n {nonExistingProp:1}) RETURN n
Description of the returned code

One of the property names in your query is not available in the database, make sure you didn’t misspell it or that the label is available when you run this statement in your application (the missing property name is: nonExistingProp)

Suggestions for improvement

Make sure you didn’t misspell the property key. If the property key will be created in the future, then no change is needed to the query.

UNSUPPORTED category

Notifications with the unsupported category are created if the query or command is trying to use features that are not supported by the current system or using experimental features that should not be used in production.

RuntimeUnsupportedWarning

Table 14. Notification details

Code

Neo.ClientNotification.Statement.RuntimeUnsupportedWarning

Title

This query is not supported by the chosen runtime.

Severity

WARNING

Category

UNSUPPORTED

Example 15. The chosen runtime is not supported for the given query
Query
CYPHER runtime=pipelined SHOW INDEXES YIELD *
Description of the returned code

Selected runtime is unsupported for this query, please use a different runtime instead or fallback to default. (Pipelined does not yet support the plans including ShowIndexes, use another runtime.)

Suggestions for improvement

Use a different runtime or remove the runtime option to run the query with the default runtime:

SHOW INDEXES YIELD *

RuntimeExperimental

Table 15. Notification details

Code

Neo.ClientNotification.Statement.RuntimeExperimental

Title

This feature is experimental and should not be used in production systems.

Severity

WARNING

Category

UNSUPPORTED

Example 16. Use of the parallel runtime
Query
CYPHER runtime=parallel MATCH (n) RETURN (n)
Description of the returned code

You are using an experimental feature (The parallel runtime is experimental and might suffer from instability and potentially correctness issues.)

Suggestions for improvement

The parallel runtime should not be used in production. Choose another runtime or remove the option to use the default runtime:

MATCH (n) RETURN (n)

DEPRECATION category

Notifications within the deprecation category contain information about a feature or functionality which has been deprecated. It is important to change to the new functionality, otherwise, the query might break in a future version.

FeatureDeprecationWarning

Table 16. Notification details

Code

Neo.ClientNotification.Statement.FeatureDeprecationWarning

Title

This feature is deprecated and will be removed in future versions.

Severity

WARNING

Category

DEPRECATION

Example 17. Colon after the | in a relationship pattern
Query
MATCH (a)-[:A|:B|:C]-() RETURN *
Description of the returned code

The semantics of using colon in the separation of alternative relationship types will change in a future version. (Please use ':A|B|C' instead)

Suggestions for improvement

Remove the colon inside the relationship type expression.

MATCH (a)-[:A|B|C]-() RETURN *
Example 18. Setting properties using a node
Query
MATCH (a)-[]-(b)
SET a = b
Description of the returned code

The use of nodes or relationships for setting properties is deprecated and will be removed in a future version. Please use properties() instead.

Suggestions for improvement

Use the properties() function to get all properties from b.

MATCH (a)-[]-(b)
SET a = properties(b)
Example 19. Setting properties using a relationship
Query
MATCH (a)-[r]-(b)
SET a += r
Description of the returned code

The use of nodes or relationships for setting properties is deprecated and will be removed in a future version. Please use properties() instead.

Suggestions for improvement

Use the properties() function to get all properties from r

MATCH (a)-[r]-(b)
SET a += properties(r)
Example 20. Shortest path with a fixed relationship length
Query
MATCH (a:Start), shortestPath((a)-[r]->()) RETURN a
Description of the returned code

The use of shortestPath and allShortestPaths with fixed length relationships is deprecated and will be removed in a future version. Please use a path with a length of 1 [r*1..1] instead or a Match with a limit.

Suggestions for improvement

If the relationship length is fixed, there is no reason to search for the shortest path. Instead, you can rewrite it to the following:

MATCH (a: Start)-[r]->(b: End) RETURN b LIMIT 1
Example 21. Create a database with an unescaped name containing a dot
Query
CREATE DATABASE foo.bar
Description of the returned code

Databases and aliases with unescaped . are deprecated unless to indicate that they belong to a composite database. Names containing . should be escaped. (Name: foo.bar)

Suggestions for improvement

If not intended for a composite database, escape the name with the character `.

CREATE DATABASE `foo.bar`
Example 22. A procedure has been deprecated or renamed
CALL unsupported.dbms.shutdown
Description of the returned code

The query used a deprecated procedure: 'unsupported.dbms.shutdown'.

Suggestions for improvement

Remove the use of the deprecated procedure. If there is a suggested replacement, update to use the replacement instead.

Example 23. Using a deprecated runtime option
Query
CYPHER runtime = interpreted MATCH (n) RETURN n
Description of the returned code

The query used a deprecated runtime option. ('runtime=interpreted' is deprecated, please use 'runtime=slotted' instead)

Suggestions for improvement

Runtime interpreted is deprecated, use another runtime or remove the runtime option to use the default runtime.

MATCH (n) RETURN n
Example 24. Using the text-1.0 index provider when creating a text index
Query
CREATE TEXT INDEX FOR (n:Label) ON (n.prop) OPTIONS {indexProvider : 'text-1.0'}
Description of the returned code

The text-1.0 provider for text indexes is deprecated and will be removed in a future version. Please use text-2.0 instead.

Suggestions for improvement

Update the option indexProvider with the value text-2.0.

CREATE TEXT INDEX FOR (n:Label) ON (n.prop) OPTIONS {indexProvider : 'text-2.0'}
Example 25. Using differently ordered return items in a UNION clause
Query
RETURN 'val' as one, 'val' as two
UNION
RETURN 'val' as two, 'val' as one
Description of the returned code

All subqueries in a UNION [ALL] should have the same ordering for the return columns. Using differently ordered return items in a UNION [ALL] clause is deprecated and will be removed in a future version.

Suggestions for improvement

Use the same order for the return columns in all subqueries combined by a UNION clause.

RETURN 'val' as one, 'val' as two
UNION
RETURN 'val' as one, 'val' as two
Example 26. Using id() function
Query
MATCH (a)
RETURN id(a)
Description of the returned code

The query used a deprecated function: id.

Suggestions for improvement

Use the function elementId() instead.

MATCH (a)
RETURN elementId(a)
Example 27. Using Cypher query option connectComponentsPlanner
Query
CYPHER connectComponentsPlanner=greedy MATCH (a), (b) RETURN *
Description of the returned code

The Cypher query option connectComponentsPlanner is deprecated and will be removed without a replacement. The product’s default behavior of using a cost-based IDP search algorithm when combining sub-plans will be kept. For more information, see Cypher manual → Cypher planner.

DeprecatedFormat

Table 17. Notification details

Code

Neo.ClientNotification.Request.DeprecatedFormat

Title

The client requested a deprecated format.

Severity

WARNING

Category

DEPRECATION

GENERIC category

GENERIC notification codes do not belong to any wider category and do not have any connection to each other.

SubqueryVariableShadowing

Table 18. Notification details

Code

Neo.ClientNotification.Statement.SubqueryVariableShadowing

Title

Variable in subquery is shadowing a variable with the same name from the outer scope.

Severity

INFORMATION

Category

GENERIC

Example 28. Shadowing of a variable from the outer scope
Query
MATCH (n)
CALL {
  MATCH (n)--(m)
  RETURN m
}
RETURN *
Description of the returned code

Variable in subquery is shadowing a variable with the same name from the outer scope. If you want to use that variable instead, it must be imported into the subquery using importing WITH clause. (the shadowing variable is: n)

Suggestions for improvement

If the intended behavior of the query is for the variable in the subquery to be a new variable, then nothing needs to be done. If the intended behavior is to use the variable from the outer query, it needs to be imported to the subquery using the with clause.

MATCH (n)
CALL {
  WITH n
  MATCH (n)--(m)
  RETURN m
}
RETURN *

ParameterNotProvided

Table 19. Notification details

Code

Neo.ClientNotification.Statement.ParameterNotProvided

Title

The statement refers to a parameter that was not provided in the request.

Severity

WARNING

Category

GENERIC

Example 29. Using an EXPLAIN query with parameters without providing them
Query
EXPLAIN WITH $param as param RETURN param
Description of the returned code

Did not supply query with enough parameters. The produced query plan will not be cached and is not executable without EXPLAIN. (Missing parameters: param)

Suggestions for improvement

Provide the parameter to be able to cache the plan.

ProcedureWarning

Table 20. Notification details

Code

Neo.ClientNotification.Procedure.ProcedureWarning

Title

The query used a procedure that generated a warning.

Severity

WARNING

Category

GENERIC

UnsatisfiableRelationshipTypeExpression

Introduced in Neo4j 5.4

When is this notification returned?

When matching on a relationship type expression that can never be satisfied, for example asking for zero, more than one or contradictory types.

Table 21. Notification category details

Code

Neo.ClientNotification.Statement.UnsatisfiableRelationshipTypeExpression

Title

The query contains a relationship type expression that cannot be satisfied.

Severity

WARNING

Category

GENERIC

Example 30. Matching on a relationship type expression that can never be satisfied
Query
MATCH ()-[r:R1&R2]->() RETURN r
Description of the returned code

Relationship type expression cannot possibly be satisfied. (R1&R2 can never be fulfilled by any relationship. Relationships must have exactly one type.)

Neo.ClientNotification.Statement.RepeatedRelationshipReference

Table 22. Notification category details

Code

Neo.ClientNotification.Statement.RepeatedRelationshipReference

Title

The query returns no results because a relationship variable is bound more than once.

Severity

WARNING

Category

GENERIC

Example 31. Binding a relationship variable more than once (when run on version 5.5 or newer)
Query
MATCH (:A)-[r]->(), ()-[r]->(:B) RETURN r
Description of the returned code

A relationship is referenced more than once in the query, which leads to no results because relationships must not occur more than once in each result. (Relationship r was repeated)

Suggestions for improvement

Use one pattern to match all relationships that start with a node with the label A and end with a node with the label B:

MATCH (:A)-[r]->(:B) RETURN r
Example 32. Binding a variable-length relationship variable more than once (when run on version 5.6 or newer)
Query
MATCH ()-[r*]->()<-[r*]-() RETURN count(*) AS count
Description of the returned code

A variable-length relationship variable is bound more than once, which leads to no results because relationships must not occur more than once in each result. (Relationship r was repeated)