forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit05dc5f4
committed
Repair logic for reordering grouping sets optimization.
The logic in reorder_grouping_sets to order grouping set elements tomatch a pre-specified sort ordering was defective, resulting inunnecessary sort nodes (though the query output would still becorrect). Repair, simplifying the code a little, and add a test.Per report from Richard Guo, though I didn't use their patch. Originalbug seems to have been my fault.Backpatch back to 9.5 where grouping sets were introduced.Discussion:https://postgr.es/m/CAN_9JTzyjGcUjiBHxLsgqfk7PkdLGXiM=pwM+=ph2LsWw0WO1A@mail.gmail.com1 parent43085a4 commit05dc5f4
File tree
3 files changed
+34
-21
lines changed- src
- backend/optimizer/plan
- test/regress
- expected
- sql
3 files changed
+34
-21
lines changedLines changed: 18 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3438 | 3438 |
| |
3439 | 3439 |
| |
3440 | 3440 |
| |
3441 |
| - | |
3442 | 3441 |
| |
3443 | 3442 |
| |
3444 | 3443 |
| |
| |||
3448 | 3447 |
| |
3449 | 3448 |
| |
3450 | 3449 |
| |
3451 |
| - | |
| 3450 | + | |
| 3451 | + | |
3452 | 3452 |
| |
3453 |
| - | |
3454 |
| - | |
3455 |
| - | |
3456 |
| - | |
| 3453 | + | |
| 3454 | + | |
3457 | 3455 |
| |
3458 |
| - | |
3459 |
| - | |
3460 |
| - | |
3461 |
| - | |
3462 |
| - | |
3463 |
| - | |
3464 |
| - | |
3465 |
| - | |
3466 |
| - | |
3467 |
| - | |
3468 |
| - | |
| 3456 | + | |
| 3457 | + | |
| 3458 | + | |
| 3459 | + | |
3469 | 3460 |
| |
3470 |
| - | |
3471 |
| - | |
| 3461 | + | |
3472 | 3462 |
| |
3473 |
| - | |
| 3463 | + | |
| 3464 | + | |
| 3465 | + | |
3474 | 3466 |
| |
3475 | 3467 |
| |
3476 | 3468 |
| |
| 3469 | + | |
| 3470 | + | |
| 3471 | + | |
| 3472 | + | |
| 3473 | + | |
| 3474 | + | |
3477 | 3475 |
| |
3478 | 3476 |
| |
3479 |
| - | |
3480 | 3477 |
| |
3481 | 3478 |
| |
3482 | 3479 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
637 | 637 |
| |
638 | 638 |
| |
639 | 639 |
| |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
640 | 653 |
| |
641 | 654 |
| |
642 | 655 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
213 | 213 |
| |
214 | 214 |
| |
215 | 215 |
| |
| 216 | + | |
| 217 | + | |
| 218 | + | |
216 | 219 |
| |
217 | 220 |
| |
218 | 221 |
| |
|
0 commit comments
Comments
(0)