forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0a48050
committed
Expand partitioned table RTEs level by level, without flattening.
Flattening the partitioning hierarchy at this stage makes variousdesirable optimizations difficult. The original use case for thispatch was partition-wise join, which wants to match up the partitionsin one partitioning hierarchy with those in another such hierarchy.However, it now seems that it will also be useful in making partitionpruning work using the PartitionDesc rather than constraint exclusion,because with a flattened expansion, we have no easy way to figure outwhich PartitionDescs apply to which leaf tables in a multi-levelpartition hierarchy.As it turns out, we end up creating both rte->inh and !rte->inh RTEsfor each intermediate partitioned table, just as we previously did forthe root table. This seems unnecessary since the partitioned tableshave no storage and are not scanned. We might want to go back andrejigger things so that no partitioned tables (including the parent)need !rte->inh RTEs, but that seems to require some adjustments notrelated to the core purpose of this patch.Ashutosh Bapat, reviewed by me and by Amit Langote. Some finaladjustments by me.Discussion:http://postgr.es/m/CAFjFpRd=1venqLL7oGU=C1dEkuvk2DJgvF+7uKbnPHaum1mvHQ@mail.gmail.com1 parent0c4b879 commit0a48050
File tree
9 files changed
+350
-137
lines changed- src
- backend/optimizer
- path
- plan
- prep
- include/nodes
- test/regress
- expected
- sql
9 files changed
+350
-137
lines changedLines changed: 15 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
| 27 | + | |
27 | 28 |
| |
28 | 29 |
| |
29 | 30 |
| |
| |||
352 | 353 |
| |
353 | 354 |
| |
354 | 355 |
| |
355 |
| - | |
356 |
| - | |
| 356 | + | |
| 357 | + | |
357 | 358 |
| |
358 | 359 |
| |
359 | 360 |
| |
| |||
867 | 868 |
| |
868 | 869 |
| |
869 | 870 |
| |
| 871 | + | |
| 872 | + | |
| 873 | + | |
870 | 874 |
| |
871 | 875 |
| |
872 | 876 |
| |
| |||
1290 | 1294 |
| |
1291 | 1295 |
| |
1292 | 1296 |
| |
1293 |
| - | |
1294 |
| - | |
1295 |
| - | |
1296 |
| - | |
1297 |
| - | |
1298 |
| - | |
1299 |
| - | |
1300 |
| - | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
1301 | 1306 |
| |
1302 | 1307 |
| |
1303 | 1308 |
| |
1304 | 1309 |
| |
1305 | 1310 |
| |
1306 | 1311 |
| |
1307 |
| - | |
1308 | 1312 |
| |
1309 | 1313 |
| |
1310 |
| - | |
1311 |
| - | |
1312 | 1314 |
| |
1313 | 1315 |
| |
1314 | 1316 |
| |
|
Lines changed: 20 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| 18 | + | |
18 | 19 |
| |
19 | 20 |
| |
20 | 21 |
| |
| |||
629 | 630 |
| |
630 | 631 |
| |
631 | 632 |
| |
| 633 | + | |
632 | 634 |
| |
633 |
| - | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
634 | 652 |
| |
635 | 653 |
| |
636 |
| - | |
| 654 | + | |
637 | 655 |
| |
638 | 656 |
| |
639 | 657 |
| |
|
Lines changed: 61 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1038 | 1038 |
| |
1039 | 1039 |
| |
1040 | 1040 |
| |
1041 |
| - | |
| 1041 | + | |
1042 | 1042 |
| |
1043 | 1043 |
| |
1044 | 1044 |
| |
| |||
1056 | 1056 |
| |
1057 | 1057 |
| |
1058 | 1058 |
| |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
1059 | 1063 |
| |
1060 | 1064 |
| |
1061 | 1065 |
| |
| |||
1119 | 1123 |
| |
1120 | 1124 |
| |
1121 | 1125 |
| |
1122 |
| - | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1123 | 1129 |
| |
1124 |
| - | |
| 1130 | + | |
1125 | 1131 |
| |
1126 |
| - | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
1127 | 1151 |
| |
1128 | 1152 |
| |
1129 | 1153 |
| |
| |||
1137 | 1161 |
| |
1138 | 1162 |
| |
1139 | 1163 |
| |
1140 |
| - | |
| 1164 | + | |
1141 | 1165 |
| |
1142 | 1166 |
| |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
1143 | 1176 |
| |
1144 | 1177 |
| |
1145 | 1178 |
| |
1146 | 1179 |
| |
1147 | 1180 |
| |
1148 |
| - | |
| 1181 | + | |
1149 | 1182 |
| |
1150 | 1183 |
| |
1151 | 1184 |
| |
| |||
1154 | 1187 |
| |
1155 | 1188 |
| |
1156 | 1189 |
| |
1157 |
| - | |
1158 |
| - | |
| 1190 | + | |
| 1191 | + | |
1159 | 1192 |
| |
1160 | 1193 |
| |
1161 | 1194 |
| |
1162 | 1195 |
| |
1163 | 1196 |
| |
1164 | 1197 |
| |
1165 |
| - | |
| 1198 | + | |
1166 | 1199 |
| |
1167 | 1200 |
| |
1168 | 1201 |
| |
| |||
1173 | 1206 |
| |
1174 | 1207 |
| |
1175 | 1208 |
| |
1176 |
| - | |
| 1209 | + | |
1177 | 1210 |
| |
1178 | 1211 |
| |
1179 | 1212 |
| |
| |||
1190 | 1223 |
| |
1191 | 1224 |
| |
1192 | 1225 |
| |
1193 |
| - | |
| 1226 | + | |
1194 | 1227 |
| |
1195 | 1228 |
| |
1196 | 1229 |
| |
| |||
1225 | 1258 |
| |
1226 | 1259 |
| |
1227 | 1260 |
| |
1228 |
| - | |
| 1261 | + | |
1229 | 1262 |
| |
1230 | 1263 |
| |
1231 | 1264 |
| |
| |||
1272 | 1305 |
| |
1273 | 1306 |
| |
1274 | 1307 |
| |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
1275 | 1324 |
| |
1276 | 1325 |
| |
1277 | 1326 |
| |
| |||
1368 | 1417 |
| |
1369 | 1418 |
| |
1370 | 1419 |
| |
1371 |
| - | |
1372 |
| - | |
1373 |
| - | |
1374 |
| - | |
1375 |
| - | |
1376 |
| - | |
1377 |
| - | |
1378 | 1420 |
| |
1379 | 1421 |
| |
1380 | 1422 |
| |
|
0 commit comments
Comments
(0)