Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
RelOptMaterializations.getApplicableMaterializations is called each time the rule is triggered.
... // Obtain applicable (filtered) materializations // TODO: Filtering of relevant materializations needs to be // improved so we gather only materializations that might // actually generate a valid rewriting. final List<RelOptMaterialization> applicableMaterializations = RelOptMaterializations.getApplicableMaterializations(node, materializations); ...
When I implemented the rule, I assumed (incorrectly) that getApplicableMaterializations was a lightweight call and hence would help discarding materialized views extracted from the planner quickly. It turns out that the method can quickly become the most time consuming part of the rule execution; I assume the method was just supposed to be used once per query.
Since the prefiltering that we do right now is rather simple and we already extract the tables used by queries and materializations within the rule, we can just skip the materialization over there.
Attachments
Attachments
Issue Links
- links to