From 150d34045f3a1f780318b58c33494db7c353afc4 Mon Sep 17 00:00:00 2001 From: radek-starburst <94364205+radek-starburst@users.noreply.github.com> Date: Fri, 19 May 2023 11:53:19 +0200 Subject: [PATCH] Cache AccumulatorFactory instances basing on last access time Currently, AccumulatorFactory instances are flushed after one hour has elapsed. It can cause a lot of deoptimzation as an side effect. --- .../main/java/io/trino/sql/planner/LocalExecutionPlanner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/LocalExecutionPlanner.java b/core/trino-main/src/main/java/io/trino/sql/planner/LocalExecutionPlanner.java index 191c4edc9c1..cb8d4c16a6e 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/LocalExecutionPlanner.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/LocalExecutionPlanner.java @@ -437,10 +437,10 @@ public class LocalExecutionPlanner private final NonEvictableCache accumulatorFactoryCache = buildNonEvictableCache(CacheBuilder.newBuilder() .maximumSize(1000) - .expireAfterWrite(1, HOURS)); + .expireAfterAccess(1, HOURS)); private final NonEvictableCache aggregationWindowFunctionSupplierCache = buildNonEvictableCache(CacheBuilder.newBuilder() .maximumSize(1000) - .expireAfterWrite(1, HOURS)); + .expireAfterAccess(1, HOURS)); @Inject public LocalExecutionPlanner(