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

Miss data shuffle between mpp window functions #35990

Closed
LittleFall opened this issue Jul 6, 2022 · 1 comment · Fixed by #36025
Closed

Miss data shuffle between mpp window functions #35990

LittleFall opened this issue Jul 6, 2022 · 1 comment · Fixed by #36025
Assignees
Labels
affects-6.1 severity/critical sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@LittleFall
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

see #35256 (comment)

MySQL [test]> explain select row_number() over w2, row_number() over w1 from t1 window w2 as (order by c1), w1 as (partition by c1);
+--------------------------------------+----------+--------------+---------------+-----------------------------------------------------------------------------------------------+
| id                                   | estRows  | task         | access object | operator info                                                                                 |
+--------------------------------------+----------+--------------+---------------+-----------------------------------------------------------------------------------------------+
| Projection_9                         | 10000.00 | root         |               | Column#6, Column#5                                                                            |
| └─TableReader_22                     | 10000.00 | root         |               | data:ExchangeSender_21                                                                        |
|   └─ExchangeSender_21                | 10000.00 | mpp[tiflash] |               | ExchangeType: PassThrough                                                                     |
|     └─Window_10                      | 10000.00 | mpp[tiflash] |               | row_number()->Column#6 over(order by test.t1.c1 rows between current row and current row)     |
|       └─Window_12                    | 10000.00 | mpp[tiflash] |               | row_number()->Column#5 over(partition by test.t1.c1 rows between current row and current row) |
|         └─Sort_17                    | 10000.00 | mpp[tiflash] |               | test.t1.c1                                                                                    |
|           └─ExchangeReceiver_16      | 10000.00 | mpp[tiflash] |               |                                                                                               |
|             └─ExchangeSender_15      | 10000.00 | mpp[tiflash] |               | ExchangeType: HashPartition, Hash Cols: [name: test.t1.c1, collate: binary]                   |
|               └─TableFullScan_14     | 10000.00 | mpp[tiflash] | table:t1      | keep order:false, stats:pseudo                                                                |
+--------------------------------------+----------+--------------+---------------+-----------------------------------------------------------------------------------------------+
9 rows in set (0.001 sec)

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

there is an exchange in these windows

3. What did you see instead (Required)

no exchange

4. What is your TiDB version? (Required)

master

@LittleFall LittleFall added type/bug The issue is confirmed as a bug. sig/planner SIG: Planner labels Jul 6, 2022
@LittleFall LittleFall self-assigned this Jul 6, 2022
@fixdb
Copy link
Contributor

fixdb commented Jul 6, 2022

w2 is a global window, which requires data to gather into a single worker. We should see a gather exchange here. It is a planner bug, please assign it to me.

@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. 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.0 may-affects-6.1 labels Jul 7, 2022
@LittleFall LittleFall removed may-affects-4.0 This bug maybe affects 4.0.x versions. 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-5.0 This bug maybe affects 5.0.x versions. may-affects-6.0 labels Jul 7, 2022
@LittleFall LittleFall changed the title Need data shuffle between mpp window functions Miss data shuffle between mpp window functions Jul 7, 2022
ti-chi-bot pushed a commit that referenced this issue Jul 8, 2022
ti-chi-bot pushed a commit that referenced this issue Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.1 severity/critical sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
4 participants