Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-29-2021 08:47 AM
Hi! Im using Neo4j 4.3.1
I want to check if two consecutively executed queries used the same execution plan (literally the same like checking if a transaction is equal to another by id comparison).
How can i check if a plan is being re-used?
10-29-2021 12:53 PM
provided you submit query again it should not be replanned with the following exceptions
a. for some reason you have disable the query plan cache dbms.query_cache_size
b. the underlying data for the query has changed significantly enough such that the planner determines it should be replanned.
to
2021-10-22 19:00:47.881+0000 INFO id:6 - 387 ms: (planning: 386, waiting: 0) - 20080 B - 1 page hits, 0 page faults - bolt-session bolt neo4j-cypher-shell/v4.3.6 client/127.0.0.1:38380 server/127.0.0.1:7687> neo4j - - MATCH ... .... .... .....
and the planning: 386
should occur on the 1st entry but the 2nd should report planning: 0
but why ? are you suspecting the 2nd run of the same query is running a different plan?
10-30-2021 04:18 AM
Hi @dana.canzano !
Is there any particular configuration in order allow this log planning info?
I'm using Enterprise 4.2 and it doesn't show this info. Is there any way to get the start streaming info as well?
Thanks in advance,
Bennu
11-02-2021 02:51 AM
@dana.canzano
I was trying to understand the query plan caching in Neo4j so i ran a quick test with query parameters (100 merges with the same query parameter). For most of them the planning was 0 after the first one, but in some cases planning returned 8 as you can see below.
Used query -> MERGE(:HOST{IP:$ip1})
11-02-2021 04:50 AM
it could be because the data has changed significantly enough that the planner determined it needed to replan the query. When this happens your logs\debug.log will report a message similar to
2021-03-08 09:43:16.854+0000 INFO [o.n.c.i.ServerExecutionEngine] Discarded stale query from the query cache: match n return n ... ... ...
All the sessions of the conference are now available online