forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita14a583
committed
Add additional regression tests for select_active_windows
During the development of728202b, which was aimed at reducing thenumber of sorts required to evaluate multiple window functions withdifferent WindowClause definitions, the code written sorted theWindowClauses in reverse tleSortGroupRef order. There appears to be nodiscussion in the thread which was opened to discuss the development ofthis patch and no comments mentioning the fact that having theWindowClauses in reverse tleSortGroupRef order makes it more likely thatthe final WindowClause to be evaluated will provide presorted input tothe query's DISTINCT or ORDER BY clause. The reason for this is that thetleSortGroupRef indexes are assigned for the DISTINCT and ORDER BY clausesbefore they are for the WindowClauses PARTITION BY and ORDER BY clauses.Putting the WindowClause with the lowest tleSortGroupRef last means thatit's more likely that no additional sorting is required for the query'sDISTINCT or ORDER BY clause.All we're doing here is adding some tests and a comment to help ensurethat remains true and that we don't accidentally forget to consider thisagain should we ever rewrite that code.Author: Ankit Kumar Pandey, David RowleyDiscussion:https://postgr.es/m/CAApHDvq=g2=ny59f1bvwRVvupsgPHK-KjLPBsSL25fVuGZ4idQ@mail.gmail.com1 parentc6e1f62 commita14a583
File tree
3 files changed
+156
-0
lines changed- src
- backend/optimizer/plan
- test/regress
- expected
- sql
3 files changed
+156
-0
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5672 | 5672 |
| |
5673 | 5673 |
| |
5674 | 5674 |
| |
| 5675 | + | |
| 5676 | + | |
| 5677 | + | |
| 5678 | + | |
| 5679 | + | |
| 5680 | + | |
| 5681 | + | |
| 5682 | + | |
5675 | 5683 |
| |
5676 | 5684 |
| |
5677 | 5685 |
| |
|
Lines changed: 98 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3885 | 3885 |
| |
3886 | 3886 |
| |
3887 | 3887 |
| |
| 3888 | + | |
| 3889 | + | |
| 3890 | + | |
| 3891 | + | |
| 3892 | + | |
| 3893 | + | |
| 3894 | + | |
| 3895 | + | |
| 3896 | + | |
| 3897 | + | |
| 3898 | + | |
| 3899 | + | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
| 3920 | + | |
| 3921 | + | |
| 3922 | + | |
| 3923 | + | |
| 3924 | + | |
| 3925 | + | |
| 3926 | + | |
| 3927 | + | |
| 3928 | + | |
| 3929 | + | |
| 3930 | + | |
| 3931 | + | |
| 3932 | + | |
| 3933 | + | |
| 3934 | + | |
| 3935 | + | |
| 3936 | + | |
| 3937 | + | |
| 3938 | + | |
| 3939 | + | |
| 3940 | + | |
| 3941 | + | |
| 3942 | + | |
| 3943 | + | |
| 3944 | + | |
| 3945 | + | |
| 3946 | + | |
| 3947 | + | |
| 3948 | + | |
| 3949 | + | |
| 3950 | + | |
| 3951 | + | |
| 3952 | + | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
| 3956 | + | |
| 3957 | + | |
| 3958 | + | |
| 3959 | + | |
| 3960 | + | |
| 3961 | + | |
| 3962 | + | |
| 3963 | + | |
| 3964 | + | |
| 3965 | + | |
| 3966 | + | |
| 3967 | + | |
| 3968 | + | |
| 3969 | + | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
| 3977 | + | |
| 3978 | + | |
| 3979 | + | |
| 3980 | + | |
| 3981 | + | |
| 3982 | + | |
| 3983 | + | |
| 3984 | + | |
| 3985 | + | |
3888 | 3986 |
| |
3889 | 3987 |
| |
3890 | 3988 |
| |
|
Lines changed: 50 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1276 | 1276 |
| |
1277 | 1277 |
| |
1278 | 1278 |
| |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
1279 | 1329 |
| |
1280 | 1330 |
| |
1281 | 1331 |
| |
|
0 commit comments
Comments
(0)