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: Wrong plan for mpp window <-- agg #43922

Closed
SeaRise opened this issue May 17, 2023 · 0 comments · Fixed by #43981
Closed

planner: Wrong plan for mpp window <-- agg #43922

SeaRise opened this issue May 17, 2023 · 0 comments · Fixed by #43981

Comments

@SeaRise
Copy link
Contributor

SeaRise commented May 17, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table test.t1(c1 int, c2 int);
insert into test.t1 values(1, 1),(2, 2),(3, 3),(1, 1),(2, 2),(3, 3),(4, 4);
alter table test.t1 set tiflash replica 1;
set tidb_allow_mpp=1;set tidb_enforce_mpp=1; set tidb_isolation_read_engines='tiflash';
explain select c1, row_number() OVER() from (select c1 from test.t1 group by c1) t;

2. What did you expect to see? (Required)

There should be a PassThrough Exchange between window and agg.

3. What did you see instead (Required)

+------------------------------------+---------+--------------+---------------+------------------------------------------------------------------------------------------------------------------+
| id                                 | estRows | task         | access object | operator info                                                                                                    |
+------------------------------------+---------+--------------+---------------+------------------------------------------------------------------------------------------------------------------+
| TableReader_81                     | 5.60    | root         |               | MppVersion: 1, data:ExchangeSender_80                                                                            |
| └─ExchangeSender_80                | 5.60    | mpp[tiflash] |               | ExchangeType: PassThrough                                                                                        |
|   └─Window_79                      | 5.60    | mpp[tiflash] |               | row_number()->Column#5 over(rows between current row and current row)                                            |
|     └─Projection_19                | 5.60    | mpp[tiflash] |               | test.t1.c1                                                                                                       |
|       └─HashAgg_12                 | 5.60    | mpp[tiflash] |               | group by:test.t1.c1, funcs:firstrow(test.t1.c1)->test.t1.c1, stream_count: 20                                    |
|         └─ExchangeReceiver_18      | 7.00    | mpp[tiflash] |               | stream_count: 20                                                                                                 |
|           └─ExchangeSender_17      | 7.00    | mpp[tiflash] |               | ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t1.c1, collate: binary], stream_count: 20 |
|             └─TableFullScan_16     | 7.00    | mpp[tiflash] | table:t1      | keep order:false, stats:pseudo                                                                                   |
+------------------------------------+---------+--------------+---------------+------------------------------------------------------------------------------------------------------------------+

4. What is your TiDB version? (Required)

master

@SeaRise SeaRise added the type/bug The issue is confirmed as a bug. label May 17, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels May 18, 2023
@windtalker windtalker added affects-6.1 affects-6.5 affects-7.1 and removed may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels May 22, 2023
ti-chi-bot bot pushed a commit that referenced this issue May 22, 2023
ti-chi-bot bot pushed a commit that referenced this issue May 23, 2023
ti-chi-bot bot pushed a commit that referenced this issue May 24, 2023
ti-chi-bot bot pushed a commit that referenced this issue May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants