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. |
Code |
|
Title |
This query builds a cartesian product between disconnected patterns. |
Severity |
|
Category |
|
- 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. |
Code |
|
Title |
The provided pattern is unbounded, consider adding an upper limit to the number of node hops. |
Severity |
|
Category |
|
- 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. |
Code |
|
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 |
|
Category |
|
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 theMATCH
containing the shortest path from the existential predicates on that path. - Suggestions for improvement
-
Separate the predicate by introducing a
WITH
after theMATCH
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, |
Code |
|
Title |
Adding a schema index may speed up this query. |
Severity |
|
Category |
|
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 aMATCH
orMERGE
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. |
Code |
|
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 |
|
Category |
|
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
Code |
|
Title |
Queries using dynamic properties will use neither index seeks nor index scans for those properties |
Severity |
|
Category |
|
- 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, ifprop
is equal toname
, the following query would be able to use the index:MATCH (n:Person) WHERE n.name IS NOT NULL RETURN n;
- 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 tosince
, you can rewrite the query to:MATCH ()-[r: KNOWS]->() WHERE r.since IS NOT NULL RETURN r
CodeGenerationFailed
Code |
|
Title |
The database was unable to generate code for the query. A stack trace can be found in the debug.log. |
Severity |
|
Category |
|
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
Code |
|
Title |
The database was unable to plan a hinted join. |
Severity |
|
Category |
|
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
Code |
|
Title |
The request (directly or indirectly) referred to an index that does not exist. |
Severity |
|
Category |
|
- 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.
- 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
Code |
|
Title |
The request referred to a home database that does not exist. |
Severity |
|
Category |
|
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
Code |
|
Title |
The provided label is not in the database. |
Severity |
|
Category |
|
- 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
Code |
|
Title |
The provided relationship type is not in the database. |
Severity |
|
Category |
|
- 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
Code |
|
Title |
The provided property key is not in the database |
Severity |
|
Category |
|
- 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
Code |
|
Title |
This query is not supported by the chosen runtime. |
Severity |
|
Category |
|
- 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
Code |
|
Title |
This feature is experimental and should not be used in production systems. |
Severity |
|
Category |
|
- 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
Code |
|
Title |
This feature is deprecated and will be removed in future versions. |
Severity |
|
Category |
|
- 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 *
- 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 fromb
.MATCH (a)-[]-(b) SET a = properties(b)
- 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 fromr
MATCH (a)-[r]-(b) SET a += properties(r)
- Query
-
MATCH (a:Start), shortestPath((a)-[r]->()) RETURN a
- Description of the returned code
-
The use of
shortestPath
andallShortestPaths
with fixed length relationships is deprecated and will be removed in a future version. Please use a path with a length of1 [r*1..1]
instead or aMatch
with alimit
. - 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
- 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`
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.
- 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
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 usetext-2.0
instead. - Suggestions for improvement
-
Update the option
indexProvider
with the valuetext-2.0
.CREATE TEXT INDEX FOR (n:Label) ON (n.prop) OPTIONS {indexProvider : 'text-2.0'}
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
- 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)
- 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.
GENERIC
category
GENERIC
notification codes do not belong to any wider category and do not have any connection to each other.
SubqueryVariableShadowing
Code |
|
Title |
Variable in subquery is shadowing a variable with the same name from the outer scope. |
Severity |
|
Category |
|
- 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
Code |
|
Title |
The statement refers to a parameter that was not provided in the request. |
Severity |
|
Category |
|
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
Code |
|
Title |
The query used a procedure that generated a warning. |
Severity |
|
Category |
|
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. |
Code |
|
Title |
The query contains a relationship type expression that cannot be satisfied. |
Severity |
|
Category |
|
- 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
Code |
|
Title |
The query returns no results because a relationship variable is bound more than once. |
Severity |
|
Category |
|
- 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 labelB
:MATCH (:A)-[r]->(:B) RETURN r
- 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)
Was this page helpful?