- Notifications
You must be signed in to change notification settings - Fork5
Commit28b0478
committed
Handle restriction clause lists more uniformly in postgres_fdw.
Clauses in the lists retained by postgres_fdw during planning weresometimes bare boolean clauses, sometimes RestrictInfos, and sometimesa mixture of the two in the same list. The comment about that situationdidn't come close to telling the full truth, either. Aside from beingconfusing, this had a couple of bad practical consequences:* waste of planning cycles due to inability to cache per-clause selectivityand cost estimates;* sometimes, RestrictInfos would sneak into the fdw_private list of afinished Plan node, causing failures if, for example, we tried to shipthe Plan tree to a parallel worker.(It may well be that it's a bug in the parallel-query logic that wewould ever try to ship such a plan to a parallel worker, but in anycase this deserves to be cleaned up.)To fix, rearrange so that clause lists in PgFdwRelationInfo are alwayslists of RestrictInfos, and then strip the RestrictInfos at the lastminute when making a Plan node. In passing do a bit of refactoring andcomment cleanup in postgresGetForeignPlan and foreign_join_ok.Although the messiness here dates back at least to 9.6, there's no evidencethat it causes anything worse than wasted planning cycles in 9.6, so noback-patch for now.Per fuzz testing by Andreas Seltenreich.Tom Lane and Ashutosh BapatDiscussion:https://postgr.es/m/87tw5x4vcu.fsf@credativ.de1 parentff7bce1 commit28b0478
File tree
3 files changed
+168
-135
lines changed- contrib/postgres_fdw
3 files changed
+168
-135
lines changedLines changed: 16 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
210 | 210 |
| |
211 | 211 |
| |
212 | 212 |
| |
213 |
| - | |
| 213 | + | |
214 | 214 |
| |
215 | 215 |
| |
216 | 216 |
| |
| |||
869 | 869 |
| |
870 | 870 |
| |
871 | 871 |
| |
| 872 | + | |
872 | 873 |
| |
873 | 874 |
| |
874 | 875 |
| |
| |||
884 | 885 |
| |
885 | 886 |
| |
886 | 887 |
| |
887 |
| - | |
888 |
| - | |
889 |
| - | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
890 | 896 |
| |
891 | 897 |
| |
892 | 898 |
| |
| |||
1049 | 1055 |
| |
1050 | 1056 |
| |
1051 | 1057 |
| |
| 1058 | + | |
1052 | 1059 |
| |
1053 | 1060 |
| |
1054 | 1061 |
| |
| |||
1262 | 1269 |
| |
1263 | 1270 |
| |
1264 | 1271 |
| |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
1265 | 1275 |
| |
1266 | 1276 |
| |
1267 | 1277 |
| |
| |||
1278 | 1288 |
| |
1279 | 1289 |
| |
1280 | 1290 |
| |
1281 |
| - | |
1282 |
| - | |
1283 |
| - | |
1284 |
| - | |
| 1291 | + | |
1285 | 1292 |
| |
1286 |
| - | |
1287 |
| - | |
1288 |
| - | |
1289 |
| - | |
1290 |
| - | |
| 1293 | + | |
1291 | 1294 |
| |
1292 | 1295 |
| |
1293 | 1296 |
| |
|
0 commit comments
Comments
(0)