Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

planner & mpp: need a explicit MPPPartitionType to mark PassThrough Exchange. #31762

Closed
LittleFall opened this issue Jan 18, 2022 · 1 comment · Fixed by #31766
Closed

planner & mpp: need a explicit MPPPartitionType to mark PassThrough Exchange. #31762

LittleFall opened this issue Jan 18, 2022 · 1 comment · Fixed by #31766
Assignees
Labels
MPP related to MPP in tiflash sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@LittleFall
Copy link
Contributor

LittleFall commented Jan 18, 2022

Enhancement

Currently, ExchangeSender/Receiver has an exchange type PassThrough, It corresponds to AnyType in MPPPartitionType. But AnyType may also mean Don't exchange, which creates several inconveniences; For example:

  1. if we want to do a passthrough exchange, we must explicitly call the function enforceExchangerImpl, instead of guaranteeing it by enforceProperty.
  2. AnyType of MPPPartitionType is ambiguous, it may represent an exchange that does not require an exchange, or it may represent an exchange that requires an exchange.
  3. It may bring difficulties for new operators to push down, such as window function push down, it may need a sort after passthrough exchange.
  4. AnyType can't reuse the property, such as this sql will do an extra passthrough.
mysql>  explain select count(distinct a) from (select count(distinct deptid) a from employee) x;
+----------------------------------------------+---------+-------------------+----------------+------------------------------------------------------+
| id                                           | estRows | task              | access object  | operator info                                        |
+----------------------------------------------+---------+-------------------+----------------+------------------------------------------------------+
| TableReader_51                               | 1.00    | root              |                | data:ExchangeSender_50                               |
| └─ExchangeSender_50                          | 1.00    | batchCop[tiflash] |                | ExchangeType: PassThrough                            |
|   └─Projection_46                            | 1.00    | batchCop[tiflash] |                | Column#6                                             |
|     └─HashAgg_47                             | 1.00    | batchCop[tiflash] |                | funcs:count(distinct Column#5)->Column#6             |
|       └─ExchangeReceiver_49                  | 1.00    | batchCop[tiflash] |                |                                                      |
|         └─ExchangeSender_48                  | 1.00    | batchCop[tiflash] |                | ExchangeType: PassThrough                            |
|           └─HashAgg_45                       | 1.00    | batchCop[tiflash] |                | group by:Column#5,                                   |
|             └─Projection_35                  | 1.00    | batchCop[tiflash] |                | Column#5                                             |
|               └─HashAgg_36                   | 1.00    | batchCop[tiflash] |                | funcs:count(distinct test.employee.deptid)->Column#5 |
|                 └─ExchangeReceiver_38        | 1.00    | batchCop[tiflash] |                |                                                      |
|                   └─ExchangeSender_37        | 1.00    | batchCop[tiflash] |                | ExchangeType: PassThrough                            |
|                     └─HashAgg_34             | 1.00    | batchCop[tiflash] |                | group by:test.employee.deptid,                       |
|                       └─TableFullScan_19     | 17.00   | batchCop[tiflash] | table:employee | keep order:false, stats:pseudo                       |
+----------------------------------------------+---------+-------------------+----------------+------------------------------------------------------+
13 rows in set (0.00 sec)
@LittleFall LittleFall added the type/enhancement The issue or PR belongs to an enhancement. label Jan 18, 2022
@LittleFall LittleFall changed the title planner & mpp: need a explicit MPPPartitionType to mark need PassThrough Exchange. planner & mpp: need a explicit MPPPartitionType to mark PassThrough Exchange. Jan 18, 2022
@LittleFall
Copy link
Contributor Author

cc @fzhedu @windtalker @winoros

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MPP related to MPP in tiflash sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant