- Notifications
You must be signed in to change notification settings - Fork28
Commit3915178
committed
Fix testing of parallel-safety of SubPlans.
is_parallel_safe() supposed that the only relevant property of a SubPlanwas the parallel safety of the referenced subplan tree. This is wrong:the testexpr or args subtrees might contain parallel-unsafe stuff, asdemonstrated by the test case added here. However, just recursing into thesubtrees fails in a different way: we'll typically find PARAM_EXEC Paramsrepresenting the subplan's output columns in the testexpr. The previouscoding supposed that any Param must be treated as parallel-restricted, sothat a naive attempt at fixing this disabled parallel pushdown of SubPlansaltogether. We must instead determine, for any visited Param, whether itis one that would be computed by a surrounding SubPlan node; if so, it'ssafe to push down along with the SubPlan node.We might later be able to extend this logic to cope with Params used forcorrelated subplans and other cases; but that's a task for v11 or beyond.Tom Lane and Amit KapilaDiscussion:https://postgr.es/m/7064.1492022469@sss.pgh.pa.us1 parent539f670 commit3915178
File tree
4 files changed
+57
-6
lines changed- src
- backend/optimizer/util
- include/nodes
- test/regress
- expected
- sql
4 files changed
+57
-6
lines changedLines changed: 39 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
93 | 93 |
| |
94 | 94 |
| |
95 | 95 |
| |
| 96 | + | |
96 | 97 |
| |
97 | 98 |
| |
98 | 99 |
| |
| |||
1056 | 1057 |
| |
1057 | 1058 |
| |
1058 | 1059 |
| |
| 1060 | + | |
1059 | 1061 |
| |
1060 | 1062 |
| |
1061 | 1063 |
| |
| |||
1084 | 1086 |
| |
1085 | 1087 |
| |
1086 | 1088 |
| |
| 1089 | + | |
1087 | 1090 |
| |
1088 | 1091 |
| |
1089 | 1092 |
| |
| |||
1171 | 1174 |
| |
1172 | 1175 |
| |
1173 | 1176 |
| |
1174 |
| - | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
1175 | 1183 |
| |
1176 |
| - | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
1177 | 1203 |
| |
1178 | 1204 |
| |
1179 | 1205 |
| |
1180 |
| - | |
| 1206 | + | |
| 1207 | + | |
1181 | 1208 |
| |
1182 | 1209 |
| |
1183 | 1210 |
| |
1184 |
| - | |
1185 |
| - | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
1186 | 1220 |
| |
1187 | 1221 |
| |
1188 | 1222 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
699 | 699 |
| |
700 | 700 |
| |
701 | 701 |
| |
702 |
| - | |
| 702 | + | |
| 703 | + | |
703 | 704 |
| |
704 | 705 |
| |
705 | 706 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
126 | 126 |
| |
127 | 127 |
| |
128 | 128 |
| |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
129 | 141 |
| |
130 | 142 |
| |
131 | 143 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
49 | 53 |
| |
50 | 54 |
| |
51 | 55 |
| |
|
0 commit comments
Comments
(0)