xiaojunjie commented on code in PR #16980: URL: https://github.com/apache/doris/pull/16980#discussion_r1127291800
########## fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java: ########## @@ -203,6 +217,33 @@ private void analyze() { cascadesContext.newAnalyzer().analyze(); } + private void cache() { + ConnectContext connectContext = cascadesContext.getConnectContext(); + CacheContext cacheContext = cascadesContext.getStatementContext().getCacheContext(); + boolean isEnableSqlCache = Config.cache_enable_sql_mode + && connectContext.getSessionVariable().isEnableSqlCache(); + boolean isEnablePartitionCache = Config.cache_enable_partition_mode + && connectContext.getSessionVariable().isEnablePartitionCache(); + Plan plan = cascadesContext.getRewritePlan(); + if (!isEnableSqlCache && !isEnablePartitionCache) { + return; + } + if (!cacheContext.checkOlapScans(plan.collect(OlapScan.class::isInstance))) { + return; + } + if (isEnableSqlCache && cacheContext.isEnableSqlCache()) { + cacheContext.setCacheKey(plan.treeString()); + SqlCache.getCacheDataForNereids(cacheContext); + return; + } + if (!cacheContext.checkAggs(plan.collect(LogicalAggregate.class::isInstance))) { Review Comment: In the legacy planner, the cache model may change when checking partition, instead of cache miss -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org