forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit456fa63
committed
Teach planner about more monotonic window functions
9d9c02c introduced runConditions for window functions to allowmonotonic window function evaluation to be made more efficient when thewindow function value went beyond some value that it would never go backfrom due to its monotonic nature. That commit added prosupport functionsto inform the planner that row_number(), rank(), dense_rank() and someforms of count(*) were monotonic. Here we add support for ntile(),cume_dist() and percent_rank().Reviewed-by: Melanie PlagemanDiscussion:https://postgr.es/m/CAApHDvqR+VqB8s+xR-24bzJbU8xyFrBszJ17qKgECf7cWxLCaA@mail.gmail.com1 parent783d8ab commit456fa63
File tree
3 files changed
+50
-16
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+50
-16
lines changedLines changed: 30 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
288 | 288 |
| |
289 | 289 |
| |
290 | 290 |
| |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
291 | 300 |
| |
292 | 301 |
| |
293 | 302 |
| |
| |||
362 | 371 |
| |
363 | 372 |
| |
364 | 373 |
| |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
365 | 383 |
| |
366 | 384 |
| |
367 | 385 |
| |
| |||
465 | 483 |
| |
466 | 484 |
| |
467 | 485 |
| |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
468 | 498 |
| |
469 | 499 |
| |
470 | 500 |
| |
|
Lines changed: 14 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3766 | 3766 |
| |
3767 | 3767 |
| |
3768 | 3768 |
| |
3769 |
| - | |
| 3769 | + | |
| 3770 | + | |
3770 | 3771 |
| |
3771 |
| - | |
3772 |
| - | |
3773 |
| - | |
| 3772 | + | |
| 3773 | + | |
| 3774 | + | |
3774 | 3775 |
| |
3775 | 3776 |
| |
3776 |
| - | |
| 3777 | + | |
3777 | 3778 |
| |
3778 | 3779 |
| |
3779 | 3780 |
| |
3780 | 3781 |
| |
3781 |
| - | |
| 3782 | + | |
3782 | 3783 |
| |
3783 | 3784 |
| |
3784 | 3785 |
| |
| |||
3793 | 3794 |
| |
3794 | 3795 |
| |
3795 | 3796 |
| |
3796 |
| - | |
| 3797 | + | |
| 3798 | + | |
3797 | 3799 |
| |
3798 |
| - | |
3799 |
| - | |
3800 |
| - | |
3801 |
| - | |
3802 |
| - | |
| 3800 | + | |
| 3801 | + | |
| 3802 | + | |
| 3803 | + | |
| 3804 | + | |
3803 | 3805 |
| |
3804 | 3806 |
| |
3805 | 3807 |
| |
|
Lines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1220 | 1220 |
| |
1221 | 1221 |
| |
1222 | 1222 |
| |
1223 |
| - | |
| 1223 | + | |
| 1224 | + | |
1224 | 1225 |
| |
1225 |
| - | |
| 1226 | + | |
1226 | 1227 |
| |
1227 | 1228 |
| |
1228 | 1229 |
| |
1229 | 1230 |
| |
1230 | 1231 |
| |
1231 | 1232 |
| |
1232 | 1233 |
| |
1233 |
| - | |
| 1234 | + | |
| 1235 | + | |
1234 | 1236 |
| |
1235 |
| - | |
| 1237 | + | |
1236 | 1238 |
| |
1237 | 1239 |
| |
1238 | 1240 |
| |
|
0 commit comments
Comments
(0)