Article DetailsDetailsHelp DetailsOne common cause of poor query performance is running numerous Cypher statements with literal values.This results in inefficient execution because parameters are not used, preventing full utilization of the execution plan cache.Using parameters can significantly enhance query performance by allowing for more effective caching and reuse of execution plans. If you issue 10 cypher queries identical in form but with different literals, you will not get the most optimal cache and reuse of memory and will instead incur multiple times parsing and generating an execution plan. For example, consider the below query: match (tg:asset) where tg.name = "ABC123" merge (tg)<-[:TAG_OF]-(z1:tag{name:"/DATA01/"+tg.name+"/Top_DOOR"}) merge (tg)<-[:TAG_OF]-(z2:tag{name:"/DATA01"+tg.name+"/Data_Vault"}) . . . The above query can be rewritten as follows: MATCH (tg:asset) WHERE tg.name = $gtName WITH tg UNWIND $tags as tag MERGE (tg)<-[:TAG_OF]-(:tag {name: tag.name}) By replacing the literal values in the queries with parameters, you get better execution plan caching reuse (better for execution time and memory usage). Your application needs to place all the values in a parameter list, and then you can issue 1 statement that iterates through them. InformationTitleImproving query performance by using parameters instead of literalsArticle Created Date3/15/2024, 10:57 PMURL Name4405111583507-Improving-query-performance-by-using-parameters-instead-of-literalsLast Modified Date6/6/2024, 5:24 AM