Skip to content

Commit

Permalink
Add GQLstatus to DynamicProperty and CodeGenerationFailed (#149)
Browse files Browse the repository at this point in the history
Co-authored-by: Louise Berglund <[email protected]>
  • Loading branch information
NataliaIvakina and Lojjs authored Jun 24, 2024
1 parent e4694b1 commit 94c5638
Showing 1 changed file with 136 additions and 10 deletions.
146 changes: 136 additions & 10 deletions modules/ROOT/pages/notifications/all-notifications.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,13 @@ RETURN line
[#_neo_clientnotification_statement_dynamicproperty]
=== DynamicProperty

.Notification details
==== Notification details

[.tabbed-example]
=====
[.include-with-neo4j-code]
======

[cols="<1s,<4"]
|===
|Neo4j code
Expand All @@ -566,8 +572,35 @@ m|INFORMATION
m|PERFORMANCE
|===

.Using a dynamic node property key makes it impossible to use indexes
====
======
[.include-with-GQLSTATUS-code]
======

[cols="<1s,<4"]
|===
|GQLSTATUS code
m|03N95
|StatusDescription
a|info: dynamic property.
An index exists on label/type(s) `$label_list`.
It is not possible to use indexes for dynamic properties.
Consider using static properties.
|Severity
m|INFORMATION
|Classification
m|PERFORMANCE
|===

======
=====


==== Example of when using a dynamic node property key makes it impossible to use indexes

[.tabbed-example]
=====
[.include-with-neo4j-code]
======

Query::
+
Expand All @@ -588,10 +621,47 @@ For example, if `prop` is equal to `name`, the following query would be able to
----
MATCH (n:Person) WHERE n.name IS NOT NULL RETURN n;
----
====

.Using dynamic relationship property key makes it impossible to use indexes
====
======
[.include-with-GQLSTATUS-code]
======

Query::
+
[source, cypher]
----
MATCH (n:Person) WHERE n[$prop] IS NOT NULL RETURN n;
----

Returned GQLSTATUS code::
03N95

Returned Status Description::
info: dynamic property.
An index exists on label/type(s) `Person`.
It is not possible to use indexes for dynamic properties.
Consider using static properties.

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:
+
[source, cypher]
----
MATCH (n:Person) WHERE n.name IS NOT NULL RETURN n;
----

======
=====

==== Example of when using a dynamic relationship property key makes it impossible to use indexes

[.tabbed-example]
=====
[.include-with-neo4j-code]
======

Query::
+
[source,cypher]
Expand All @@ -611,12 +681,51 @@ 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
----

====
======
[.include-with-GQLSTATUS-code]
======

Query::
+
[source,cypher]
----
MATCH ()-[r: KNOWS]->() WHERE r[$prop] IS NOT NULL RETURN r
----

Returned GQLSTATUS code::
03N95

Returned Status Description::
info: dynamic property.
An index exists on label/type(s) `KNOWS`.
It is not possible to use indexes for dynamic properties.
Consider using static properties.

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:
+
[source, cypher]
----
MATCH ()-[r: KNOWS]->() WHERE r.since IS NOT NULL RETURN r
----

======
=====

[#_neo_clientnotification_statement_codegenerationfailed]
=== CodeGenerationFailed

.Notification details
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.
For more information about the specific query, see the stack trace in the _debug.log_ file.

==== Notification details

[.tabbed-example]
=====
[.include-with-neo4j-code]
======

[cols="<1s,<4"]
|===
|Neo4j code
Expand All @@ -629,8 +738,25 @@ m|INFORMATION
m|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.
======
[.include-with-GQLSTATUS-code]
======

[cols="<1s,<4"]
|===
|GQLSTATUS code
m|01N40
|StatusDescription
a|warn: runtime unsupported.
The query cannot be executed with `preparser_input1`, `preparser_input2` is used. Cause: `$msg`.
|Severity
m|INFORMATION
|Classification
m|PERFORMANCE
|===

======
=====

[#_hint_notifications]
== `HINT` category
Expand Down

0 comments on commit 94c5638

Please sign in to comment.