You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "asdfgh19 (via GitHub)" <gi...@apache.org> on 2024/04/24 03:17:13 UTC

Re: [PR] [CALCITE-5665] Reducing ineffective matches for MaterializedViewRules [calcite]

asdfgh19 commented on code in PR #3169:
URL: https://github.com/apache/calcite/pull/3169#discussion_r1176113352


##########
core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewRule.java:
##########
@@ -92,6 +96,16 @@
 public abstract class MaterializedViewRule<C extends MaterializedViewRule.Config>
     extends RelRule<C> {
 
+  /**
+   * Cache of RelMetadataQuery to MaterializationMetadata.
+   */
+  private final LoadingCache<RelMetadataQuery, MaterializationMetadata>
+      materializationMetadataCache =
+      CacheBuilder.newBuilder()
+          .expireAfterAccess(5, TimeUnit.MINUTES)
+          .maximumSize(1_024)
+          .build(CacheLoader.from(MaterializationMetadata::new));

Review Comment:
   > Is `1_024` a typo?
   
   Not a typo, this is a reference to QuerySqlStatisticProvider#SILENT_CACHING_INSTANCE, in order to be consistent with the existing code style.



-- 
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-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org