forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita391ff3
committed
Build out the planner support function infrastructure.
Add support function requests for estimating the selectivity, cost,and number of result rows (if a SRF) of the target function.The lack of a way to estimate selectivity of a boolean-returningfunction in WHERE has been a recognized deficiency of the plannersince Berkeley days. This commit finally fixes it.In addition, non-constant estimates of cost and number of outputrows are now possible. We still fall back to looking at procostand prorows if the support function doesn't service the request,of course.To make concrete use of the possibility of estimating output rowcountfor SRFs, this commit adds support functions for array_unnest(anyarray)and the integer variants of generate_series; the lack of plausiblerowcount estimates for those, even when it's obvious to a human,has been a repeated subject of complaints. Obviously, much morecould now be done in this line, but I'm mostly just trying to getthe infrastructure in place.Discussion:https://postgr.es/m/15193.1548028093@sss.pgh.pa.us1 parent1fb57af commita391ff3
File tree
27 files changed
+792
-90
lines changed- contrib/postgres_fdw
- doc/src/sgml
- src
- backend
- optimizer
- path
- util
- utils
- adt
- cache
- include
- catalog
- nodes
- optimizer
- utils
- test/regress
- expected
- input
- output
- sql
27 files changed
+792
-90
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2779 | 2779 |
| |
2780 | 2780 |
| |
2781 | 2781 |
| |
| 2782 | + | |
2782 | 2783 |
| |
2783 | 2784 |
| |
2784 | 2785 |
| |
| |||
2788 | 2789 |
| |
2789 | 2790 |
| |
2790 | 2791 |
| |
2791 |
| - | |
| 2792 | + | |
2792 | 2793 |
| |
2793 | 2794 |
| |
2794 | 2795 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3439 | 3439 |
| |
3440 | 3440 |
| |
3441 | 3441 |
| |
| 3442 | + | |
| 3443 | + | |
| 3444 | + | |
| 3445 | + | |
| 3446 | + | |
| 3447 | + | |
| 3448 | + | |
| 3449 | + | |
| 3450 | + | |
| 3451 | + | |
| 3452 | + | |
| 3453 | + | |
| 3454 | + | |
| 3455 | + | |
| 3456 | + | |
| 3457 | + | |
| 3458 | + | |
| 3459 | + | |
| 3460 | + | |
| 3461 | + | |
| 3462 | + | |
3442 | 3463 |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
762 | 762 |
| |
763 | 763 |
| |
764 | 764 |
| |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
765 | 780 |
| |
766 | 781 |
| |
767 | 782 |
| |
|
Lines changed: 32 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2112 | 2112 |
| |
2113 | 2113 |
| |
2114 | 2114 |
| |
2115 |
| - | |
2116 |
| - | |
2117 |
| - | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
2118 | 2118 |
| |
2119 | 2119 |
| |
2120 | 2120 |
| |
| |||
2136 | 2136 |
| |
2137 | 2137 |
| |
2138 | 2138 |
| |
2139 |
| - | |
| 2139 | + | |
| 2140 | + | |
2140 | 2141 |
| |
2141 | 2142 |
| |
2142 | 2143 |
| |
| |||
2155 | 2156 |
| |
2156 | 2157 |
| |
2157 | 2158 |
| |
2158 |
| - | |
| 2159 | + | |
| 2160 | + | |
2159 | 2161 |
| |
2160 | 2162 |
| |
2161 | 2163 |
| |
| |||
2168 | 2170 |
| |
2169 | 2171 |
| |
2170 | 2172 |
| |
| 2173 | + | |
2171 | 2174 |
| |
2172 |
| - | |
| 2175 | + | |
2173 | 2176 |
| |
2174 | 2177 |
| |
2175 | 2178 |
| |
| |||
2234 | 2237 |
| |
2235 | 2238 |
| |
2236 | 2239 |
| |
2237 |
| - | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
2238 | 2245 |
| |
2239 | 2246 |
| |
2240 | 2247 |
| |
| |||
3864 | 3871 |
| |
3865 | 3872 |
| |
3866 | 3873 |
| |
3867 |
| - | |
3868 |
| - | |
| 3874 | + | |
| 3875 | + | |
3869 | 3876 |
| |
3870 | 3877 |
| |
3871 | 3878 |
| |
3872 | 3879 |
| |
3873 | 3880 |
| |
3874 | 3881 |
| |
3875 | 3882 |
| |
3876 |
| - | |
3877 |
| - | |
| 3883 | + | |
| 3884 | + | |
3878 | 3885 |
| |
3879 | 3886 |
| |
3880 | 3887 |
| |
| |||
3884 | 3891 |
| |
3885 | 3892 |
| |
3886 | 3893 |
| |
| 3894 | + | |
3887 | 3895 |
| |
3888 | 3896 |
| |
3889 |
| - | |
3890 |
| - | |
| 3897 | + | |
| 3898 | + | |
| 3899 | + | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
3891 | 3903 |
| |
3892 | 3904 |
| |
3893 | 3905 |
| |
| |||
3913 | 3925 |
| |
3914 | 3926 |
| |
3915 | 3927 |
| |
3916 |
| - | |
| 3928 | + | |
| 3929 | + | |
3917 | 3930 |
| |
3918 | 3931 |
| |
3919 | 3932 |
| |
3920 |
| - | |
| 3933 | + | |
| 3934 | + | |
3921 | 3935 |
| |
3922 | 3936 |
| |
3923 | 3937 |
| |
| |||
3941 | 3955 |
| |
3942 | 3956 |
| |
3943 | 3957 |
| |
3944 |
| - | |
3945 |
| - | |
| 3958 | + | |
| 3959 | + | |
3946 | 3960 |
| |
3947 | 3961 |
| |
3948 | 3962 |
| |
| |||
4941 | 4955 |
| |
4942 | 4956 |
| |
4943 | 4957 |
| |
4944 |
| - | |
| 4958 | + | |
4945 | 4959 |
| |
4946 | 4960 |
| |
4947 | 4961 |
| |
|
Lines changed: 16 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
| 39 | + | |
39 | 40 |
| |
40 |
| - | |
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
| |||
343 | 343 |
| |
344 | 344 |
| |
345 | 345 |
| |
346 |
| - | |
| 346 | + | |
| 347 | + | |
347 | 348 |
| |
348 | 349 |
| |
349 |
| - | |
| 350 | + | |
| 351 | + | |
350 | 352 |
| |
351 | 353 |
| |
352 |
| - | |
| 354 | + | |
| 355 | + | |
353 | 356 |
| |
354 | 357 |
| |
355 |
| - | |
| 358 | + | |
| 359 | + | |
356 | 360 |
| |
357 | 361 |
| |
358 |
| - | |
| 362 | + | |
| 363 | + | |
359 | 364 |
| |
360 | 365 |
| |
361 | 366 |
| |
| |||
392 | 397 |
| |
393 | 398 |
| |
394 | 399 |
| |
395 |
| - | |
396 |
| - | |
| 400 | + | |
| 401 | + | |
397 | 402 |
| |
398 | 403 |
| |
399 | 404 |
| |
| |||
561 | 566 |
| |
562 | 567 |
| |
563 | 568 |
| |
564 |
| - | |
| 569 | + | |
565 | 570 |
| |
566 | 571 |
| |
567 | 572 |
| |
| |||
570 | 575 |
| |
571 | 576 |
| |
572 | 577 |
| |
573 |
| - | |
| 578 | + | |
574 | 579 |
| |
575 | 580 |
| |
576 | 581 |
| |
| |||
579 | 584 |
| |
580 | 585 |
| |
581 | 586 |
| |
582 |
| - | |
| 587 | + | |
583 | 588 |
| |
584 | 589 |
| |
585 | 590 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2711 | 2711 |
| |
2712 | 2712 |
| |
2713 | 2713 |
| |
2714 |
| - | |
| 2714 | + | |
2715 | 2715 |
| |
2716 | 2716 |
| |
2717 | 2717 |
| |
|
0 commit comments
Comments
(0)