[ https://issues.apache.org/jira/browse/CALCITE-3932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090839#comment-17090839 ]
Julian Hyde commented on CALCITE-3932: -------------------------------------- It's possible that one thread will create a type and another thread will later use it. Especially in the scenario of materialized views, which are shared among connections and statements. So a thread-local cache doesn't seem to be a good fit. Also, threads might be long-lived and fairly numerous (because people use thread pools) so the cache clutter may build up. A global (static) cache with a WeakInterner sounds more promising. > Make data type cache thread local, non-evictable > ------------------------------------------------ > > Key: CALCITE-3932 > URL: https://issues.apache.org/jira/browse/CALCITE-3932 > Project: Calcite > Issue Type: Improvement > Components: core > Reporter: Haisheng Yuan > Priority: Major > Fix For: 1.23.0 > > Time Spent: 20m > Remaining Estimate: 0h > > Data type can be evicted out of cache, which is global, thread-safe. > It seems not necessary to cache them globally, because most of them are > RelRecordType, which is query dependent, not sharable between different > queries. -- This message was sent by Atlassian Jira (v8.3.4#803005)