You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "asdfgh19 (Jira)" <ji...@apache.org> on 2023/04/20 08:39:00 UTC

[jira] [Created] (CALCITE-5665) Reducing ineffective matches for MaterializedViewRules and double calculation for RelOptMaterialization's Metadata using cache

asdfgh19 created CALCITE-5665:
---------------------------------

             Summary: Reducing ineffective matches for MaterializedViewRules and double calculation for RelOptMaterialization's Metadata using cache
                 Key: CALCITE-5665
                 URL: https://issues.apache.org/jira/browse/CALCITE-5665
             Project: Calcite
          Issue Type: Improvement
          Components: core
            Reporter: asdfgh19


MaterializedViewRule such as MaterializedViewOnlyFilterRule and MaterializedViewOnlyJoinRule are easy to match, which results in multiple executions of the MaterializedViewRule#perform method, most of which are ineffective. Each execution of this method requires traversing the query relational expression tree and the materialized view relational expression tree multiple times.

For example, the MaterializedViewRelOptRulesTest#testJoinAggregateMaterializationNoAggregateFuncs9 method will execute this method 489 times.

There are many cases where we can pre-filter out invalid matches. For example, all materialized views are Aggregate MV and the current rule is MaterializedViewOnlyJoinRule.

We can also cache RelOptMaterialization Metadata to reduce repeated calculations.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)