- Notifications
You must be signed in to change notification settings - Fork5
Commitd7a6a04
committed
Fix planner to restore its previous level of intelligence about pushing
constants through full joins, as inselect * from tenk1 a full join tenk1 b using (unique1)where unique1 = 42;which should generate a fairly cheap plan where we apply the constraintunique1 = 42 in each relation scan. This had been broken by my patch of2008-06-27, which is now reverted in favor of a more invasive but hopefullyless incorrect approach. That patch was meant to prevent incorrect extractionof OR'd indexclauses from OR conditions above an outer join. To do thatcorrectly we need more information than the outerjoin_delay flag can provide,so add a nullable_relids field to RestrictInfo that records exactly whichrelations are nulled by outer joins that are underneath a particular qualclause. A side benefit is that we can make the test in create_or_index_qualsmore specific: it is now smart enough to extract an OR'd indexclause into theouter side of an outer join, even though it must not do so in the inner side.The old coding couldn't distinguish these cases so it could not do either.1 parentc5593d5 commitd7a6a04
File tree
9 files changed
+132
-68
lines changed- src
- backend
- nodes
- optimizer
- path
- plan
- util
- include
- nodes
- optimizer
9 files changed
+132
-68
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
| 18 | + | |
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| |||
1606 | 1606 |
| |
1607 | 1607 |
| |
1608 | 1608 |
| |
| 1609 | + | |
1609 | 1610 |
| |
1610 | 1611 |
| |
1611 | 1612 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
| 25 | + | |
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| |||
759 | 759 |
| |
760 | 760 |
| |
761 | 761 |
| |
| 762 | + | |
762 | 763 |
| |
763 | 764 |
| |
764 | 765 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1613 | 1613 |
| |
1614 | 1614 |
| |
1615 | 1615 |
| |
| 1616 | + | |
1616 | 1617 |
| |
1617 | 1618 |
| |
1618 | 1619 |
| |
|
Lines changed: 10 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| |||
2325 | 2325 |
| |
2326 | 2326 |
| |
2327 | 2327 |
| |
2328 |
| - | |
2329 |
| - | |
2330 |
| - | |
2331 |
| - | |
2332 |
| - | |
| 2328 | + | |
2333 | 2329 |
| |
2334 | 2330 |
| |
2335 | 2331 |
| |
| |||
2360 | 2356 |
| |
2361 | 2357 |
| |
2362 | 2358 |
| |
2363 |
| - | |
2364 |
| - | |
2365 |
| - | |
2366 |
| - | |
2367 |
| - | |
| 2359 | + | |
2368 | 2360 |
| |
2369 | 2361 |
| |
2370 | 2362 |
| |
| |||
2737 | 2729 |
| |
2738 | 2730 |
| |
2739 | 2731 |
| |
2740 |
| - | |
| 2732 | + | |
2741 | 2733 |
| |
2742 | 2734 |
| |
2743 | 2735 |
| |
| |||
2746 | 2738 |
| |
2747 | 2739 |
| |
2748 | 2740 |
| |
2749 |
| - | |
| 2741 | + | |
2750 | 2742 |
| |
2751 | 2743 |
| |
2752 | 2744 |
| |
| |||
2832 | 2824 |
| |
2833 | 2825 |
| |
2834 | 2826 |
| |
2835 |
| - | |
| 2827 | + | |
2836 | 2828 |
| |
2837 | 2829 |
| |
2838 | 2830 |
| |
| |||
2847 | 2839 |
| |
2848 | 2840 |
| |
2849 | 2841 |
| |
2850 |
| - | |
| 2842 | + | |
2851 | 2843 |
| |
2852 | 2844 |
| |
2853 | 2845 |
| |
| |||
2864 | 2856 |
| |
2865 | 2857 |
| |
2866 | 2858 |
| |
2867 |
| - | |
2868 |
| - | |
| 2859 | + | |
2869 | 2860 |
| |
2870 | 2861 |
| |
2871 | 2862 |
| |
| |||
2928 | 2919 |
| |
2929 | 2920 |
| |
2930 | 2921 |
| |
2931 |
| - | |
| 2922 | + | |
2932 | 2923 |
| |
2933 | 2924 |
| |
2934 | 2925 |
| |
| |||
2943 | 2934 |
| |
2944 | 2935 |
| |
2945 | 2936 |
| |
2946 |
| - | |
2947 |
| - | |
| 2937 | + | |
2948 | 2938 |
| |
2949 | 2939 |
| |
2950 | 2940 |
| |
|
Lines changed: 14 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
89 | 89 |
| |
90 | 90 |
| |
91 | 91 |
| |
92 |
| - | |
93 |
| - | |
94 |
| - | |
95 |
| - | |
96 |
| - | |
97 |
| - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
98 | 104 |
| |
99 | 105 |
| |
100 | 106 |
| |
101 | 107 |
| |
102 | 108 |
| |
103 | 109 |
| |
104 | 110 |
| |
105 |
| - | |
| 111 | + | |
106 | 112 |
| |
107 | 113 |
| |
108 | 114 |
| |
|
Lines changed: 50 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 |
| - | |
| 56 | + | |
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
| |||
755 | 755 |
| |
756 | 756 |
| |
757 | 757 |
| |
| 758 | + | |
758 | 759 |
| |
759 | 760 |
| |
760 | 761 |
| |
| |||
861 | 862 |
| |
862 | 863 |
| |
863 | 864 |
| |
| 865 | + | |
864 | 866 |
| |
865 | 867 |
| |
866 | 868 |
| |
| |||
882 | 884 |
| |
883 | 885 |
| |
884 | 886 |
| |
885 |
| - | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
886 | 891 |
| |
887 | 892 |
| |
888 | 893 |
| |
| |||
907 | 912 |
| |
908 | 913 |
| |
909 | 914 |
| |
910 |
| - | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
911 | 919 |
| |
912 | 920 |
| |
913 | 921 |
| |
| |||
957 | 965 |
| |
958 | 966 |
| |
959 | 967 |
| |
960 |
| - | |
| 968 | + | |
| 969 | + | |
961 | 970 |
| |
962 | 971 |
| |
963 | 972 |
| |
| |||
1064 | 1073 |
| |
1065 | 1074 |
| |
1066 | 1075 |
| |
1067 |
| - | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
1068 | 1079 |
| |
1069 | 1080 |
| |
1070 | 1081 |
| |
| |||
1087 | 1098 |
| |
1088 | 1099 |
| |
1089 | 1100 |
| |
1090 |
| - | |
1091 |
| - | |
| 1101 | + | |
| 1102 | + | |
1092 | 1103 |
| |
1093 | 1104 |
| |
1094 | 1105 |
| |
| |||
1104 | 1115 |
| |
1105 | 1116 |
| |
1106 | 1117 |
| |
1107 |
| - | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
1108 | 1121 |
| |
1109 | 1122 |
| |
1110 |
| - | |
| 1123 | + | |
| 1124 | + | |
1111 | 1125 |
| |
1112 | 1126 |
| |
1113 | 1127 |
| |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
1114 | 1138 |
| |
1115 | 1139 |
| |
1116 | 1140 |
| |
| |||
1126 | 1150 |
| |
1127 | 1151 |
| |
1128 | 1152 |
| |
1129 |
| - | |
1130 |
| - | |
1131 |
| - | |
| 1153 | + | |
1132 | 1154 |
| |
1133 | 1155 |
| |
1134 | 1156 |
| |
1135 | 1157 |
| |
1136 | 1158 |
| |
1137 | 1159 |
| |
| 1160 | + | |
1138 | 1161 |
| |
1139 | 1162 |
| |
1140 | 1163 |
| |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
1141 | 1170 |
| |
1142 | 1171 |
| |
1143 | 1172 |
| |
| |||
1146 | 1175 |
| |
1147 | 1176 |
| |
1148 | 1177 |
| |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
1149 | 1183 |
| |
| 1184 | + | |
1150 | 1185 |
| |
1151 | 1186 |
| |
1152 | 1187 |
| |
| |||
1352 | 1387 |
| |
1353 | 1388 |
| |
1354 | 1389 |
| |
1355 |
| - | |
| 1390 | + | |
| 1391 | + | |
1356 | 1392 |
| |
1357 | 1393 |
| |
1358 | 1394 |
| |
|
0 commit comments
Comments
(0)