forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc651020
committed
Remove redundant PARTITION BY columns from WindowClauses
Here we adjust the query planner to have it remove items from a windowclause's PARTITION BY clause in cases where the pathkey for a column inthe PARTITION BY clause is redundant.Doing this allows the optimization added in9d9c02c to stop windowaggregation early rather than going into "pass-through" mode to findtuples belonging to the next partition. Also, when we manage to removeall PARTITION BY columns, we now no longer needlessly check that thecurrent tuple belongs to the same partition as the last tuple innodeWindowAgg.c. If the pathkey was redundant then all tuples mustcontain the same value for the given redundant column, so there's no pointin checking that during execution.Author: David RowleyReviewed-by: Richard GuoDiscussion:https://postgr.es/m/CAApHDvo2ji+hdxrxfXtRtsfSVw3to2o1nCO20qimw0dUGK8hcQ@mail.gmail.com1 parent4637a6a commitc651020
File tree
3 files changed
+46
-14
lines changed- src
- backend/optimizer/plan
- include/nodes
3 files changed
+46
-14
lines changedLines changed: 1 addition & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2623 | 2623 |
| |
2624 | 2624 |
| |
2625 | 2625 |
| |
2626 |
| - | |
2627 |
| - | |
2628 |
| - | |
2629 |
| - | |
2630 |
| - | |
2631 |
| - | |
| 2626 | + | |
2632 | 2627 |
| |
2633 | 2628 |
| |
2634 | 2629 |
| |
|
Lines changed: 43 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5999 | 5999 |
| |
6000 | 6000 |
| |
6001 | 6001 |
| |
| 6002 | + | |
| 6003 | + | |
| 6004 | + | |
6002 | 6005 |
| |
6003 | 6006 |
| |
6004 | 6007 |
| |
| |||
6007 | 6010 |
| |
6008 | 6011 |
| |
6009 | 6012 |
| |
6010 |
| - | |
6011 |
| - | |
| 6013 | + | |
6012 | 6014 |
| |
6013 | 6015 |
| |
6014 | 6016 |
| |
| |||
6022 | 6024 |
| |
6023 | 6025 |
| |
6024 | 6026 |
| |
6025 |
| - | |
6026 |
| - | |
6027 |
| - | |
6028 |
| - | |
6029 |
| - | |
6030 |
| - | |
| 6027 | + | |
| 6028 | + | |
| 6029 | + | |
| 6030 | + | |
| 6031 | + | |
| 6032 | + | |
| 6033 | + | |
| 6034 | + | |
| 6035 | + | |
| 6036 | + | |
| 6037 | + | |
| 6038 | + | |
| 6039 | + | |
| 6040 | + | |
| 6041 | + | |
| 6042 | + | |
| 6043 | + | |
| 6044 | + | |
| 6045 | + | |
| 6046 | + | |
| 6047 | + | |
| 6048 | + | |
| 6049 | + | |
| 6050 | + | |
| 6051 | + | |
| 6052 | + | |
| 6053 | + | |
| 6054 | + | |
| 6055 | + | |
| 6056 | + | |
| 6057 | + | |
| 6058 | + | |
| 6059 | + | |
| 6060 | + | |
| 6061 | + | |
| 6062 | + | |
| 6063 | + | |
| 6064 | + | |
| 6065 | + | |
6031 | 6066 |
| |
6032 | 6067 |
| |
6033 | 6068 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1473 | 1473 |
| |
1474 | 1474 |
| |
1475 | 1475 |
| |
| 1476 | + | |
| 1477 | + | |
1476 | 1478 |
| |
1477 | 1479 |
| |
1478 | 1480 |
| |
|
0 commit comments
Comments
(0)