doris icon indicating copy to clipboard operation
doris copied to clipboard

[Feature](Nereids) Set pre-aggregation status for OLAP table scan.

Open wangshuo128 opened this issue 2 years ago • 0 comments

Proposed changes

This is the second step for #12303.

Problem summary

The previous PR #12464 added the framework to select the rollup index for OLAP table, but pre-aggregation is turned on by default. This PR set pre-aggregation for scan OLAP table.

The main steps are as below:

  1. Select rollup index when aggregate is present, this is handled by SelectRollupWithAggregate rule. Expressions in aggregate functions, grouping expressions, and pushdown predicates would be used to check whether the pre-aggregation should be turned off.
  2. When selecting from olap scan table without aggregate plan, it would be handled by SelectRollupWithoutAggregate.

Checklist(Required)

  1. Does it affect the original behavior:
    • [ ] Yes
    • [ ] No
    • [ ] I don't know
  2. Has unit tests been added:
    • [ ] Yes
    • [ ] No
    • [ ] No Need
  3. Has document been added or modified:
    • [ ] Yes
    • [ ] No
    • [ ] No Need
  4. Does it need to update dependencies:
    • [ ] Yes
    • [ ] No
  5. Are there any changes that cannot be rolled back:
    • [ ] Yes (If Yes, please explain WHY)
    • [ ] No

Further comments

If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...

wangshuo128 avatar Sep 20 '22 11:09 wangshuo128