forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5372275
committed
Fix planning of parameterized appendrel paths with expensive join quals.
The code in set_append_rel_pathlist() for building parameterized pathsfor append relations (inheritance and UNION ALL combinations) supposedthat the cheapest regular path for a child relation would still be cheapestwhen reparameterized. Which might not be the case, particularly if theadded join conditions are expensive to compute, as in a recent example fromJeff Janes. Fix it to compare child path costs *after* reparameterizing.We can short-circuit that if the cheapest pre-existing path is alreadyparameterized correctly, which seems likely to be true often enough to beworth checking for.Back-patch to 9.2 where parameterized paths were introduced.1 parent9b2543a commit5372275
File tree
3 files changed
+140
-19
lines changed- src
- backend/optimizer/path
- test/regress
- expected
- sql
3 files changed
+140
-19
lines changedLines changed: 85 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 |
| |
72 | 75 |
| |
73 | 76 |
| |
| |||
831 | 834 |
| |
832 | 835 |
| |
833 | 836 |
| |
834 |
| - | |
| 837 | + | |
835 | 838 |
| |
836 |
| - | |
837 |
| - | |
838 |
| - | |
839 |
| - | |
840 |
| - | |
841 |
| - | |
842 |
| - | |
843 |
| - | |
844 |
| - | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
845 | 843 |
| |
846 |
| - | |
847 |
| - | |
848 |
| - | |
849 |
| - | |
850 |
| - | |
851 |
| - | |
852 |
| - | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
853 | 847 |
| |
854 |
| - | |
855 |
| - | |
| 848 | + | |
856 | 849 |
| |
857 | 850 |
| |
858 | 851 |
| |
| |||
962 | 955 |
| |
963 | 956 |
| |
964 | 957 |
| |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
965 | 1031 |
| |
966 | 1032 |
| |
967 | 1033 |
| |
|
Lines changed: 34 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
603 | 603 |
| |
604 | 604 |
| |
605 | 605 |
| |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + |
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
249 | 249 |
| |
250 | 250 |
| |
251 | 251 |
| |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + |
0 commit comments
Comments
(0)