lincoln.lee created CALCITE-2104:
------------------------------------
Summary: Add separate rules for "AggregateUnionAggregateRule" to
reduce potential matching cost in VolcanoPlanner
Key: CALCITE-2104
URL: https://issues.apache.org/jira/browse/CALCITE-2104
Project: Calcite
Issue Type: Improvement
Components: core
Reporter: lincoln.lee
Assignee: Julian Hyde
Attachments: aua_rule_compare.png
Problem: when optimize some sql (has Union + Aggregate pattern) based on
VolcanoPlanner may take a long time(tens of seconds or a few minutes).
After adding the time cost statistics for each rule during the optimization
phase, I found that "AggregateUnionAggregateRule" has a large value, but the
query pattern will not be matched finally.
So I try to make a minor change for AggregateUnionAggregateRule and the
statistics shows a improvement for the same query be tested. (see the attached
image)
1. Current AggregateUnionAggregateRule's match pattern:
{code}
topAgg
|
Union
/ \
Rel Rel
{code}
2. Real patterns that can possibly be matched:
{code}
topAgg
|
Union
/ \
bottomAgg Rel
{code}
Or
{code}
topAgg
|
Union
/ \
Rel bottomAgg
{code}
Will this change reasonable? (BTW, would it be useful to add some time cost
statistics to VolcanoPlanner like the attached image below? I saw a
CalciteTimingTracer class and getSqlTimingTracer() in CalciteTracer but not
used.)
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)