forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite08d74c
committed
Allow plan nodes with initPlans to be considered parallel-safe.
If the plan itself is parallel-safe, and the initPlans are too,there's no reason anymore to prevent the plan from being markedparallel-safe. That restriction (dating to commitab77a5a) wasreally a special case of the fact that we couldn't transmit subplansto parallel workers at all. We fixed that in commit5e6d8d2 andfollow-ons, but this case never got addressed.We still forbid attaching initPlans to a Gather node that'sinserted pursuant to debug_parallel_query = regress. That's because,when we hide the Gather from EXPLAIN output, we'd hide the initPlanstoo, causing cosmetic regression diffs. It seems inadvisable tokluge EXPLAIN to the extent required to make the output look thesame, so just don't do it in that case.Along the way, this also takes care of some sloppiness about updatingpath costs to match when we move initplans from one place to anotherduring createplan.c and setrefs.c. Since all the planning decisionsare already made by that point, this is just cosmetic; but it seemsgood to keep EXPLAIN output consistent with where the initplans are.The diff in query_planner() might be worth remarking on. I found thatone because after fixing things to allow parallel-safe initplans, onepartition_prune test case changed plans (as shown in the patch) ---but only when debug_parallel_query was active. The reason proved tobe that we only bothered to mark Result nodes as potentiallyparallel-safe when debug_parallel_query is on. This neglects the factthat parallel-safety may be of interest for a sub-query even thoughthe Result itself doesn't parallelize.Discussion:https://postgr.es/m/1129530.1681317832@sss.pgh.pa.us1 parentd0d4404 commite08d74c
File tree
8 files changed
+169
-71
lines changed- src
- backend/optimizer
- plan
- util
- include/optimizer
- test/regress/expected
8 files changed
+169
-71
lines changedLines changed: 11 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6481 | 6481 |
| |
6482 | 6482 |
| |
6483 | 6483 |
| |
| 6484 | + | |
| 6485 | + | |
6484 | 6486 |
| |
6485 | 6487 |
| |
6486 | 6488 |
| |
6487 | 6489 |
| |
6488 | 6490 |
| |
6489 | 6491 |
| |
6490 | 6492 |
| |
6491 |
| - | |
6492 |
| - | |
| 6493 | + | |
6493 | 6494 |
| |
6494 | 6495 |
| |
6495 | 6496 |
| |
6496 | 6497 |
| |
| 6498 | + | |
| 6499 | + | |
| 6500 | + | |
| 6501 | + | |
| 6502 | + | |
| 6503 | + | |
6497 | 6504 |
| |
6498 | 6505 |
| |
6499 | 6506 |
| |
6500 | 6507 |
| |
6501 | 6508 |
| |
6502 | 6509 |
| |
6503 |
| - | |
6504 |
| - | |
| 6510 | + | |
| 6511 | + | |
6505 | 6512 |
| |
6506 | 6513 |
| |
6507 | 6514 |
| |
|
Lines changed: 9 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
112 | 112 |
| |
113 | 113 |
| |
114 | 114 |
| |
115 |
| - | |
116 |
| - | |
117 |
| - | |
118 |
| - | |
119 |
| - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
120 | 122 |
| |
121 | 123 |
| |
122 |
| - | |
| 124 | + | |
| 125 | + | |
123 | 126 |
| |
124 | 127 |
| |
125 | 128 |
| |
|
Lines changed: 28 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
432 | 432 |
| |
433 | 433 |
| |
434 | 434 |
| |
435 |
| - | |
436 |
| - | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
437 | 448 |
| |
438 | 449 |
| |
439 |
| - | |
440 |
| - | |
441 |
| - | |
442 |
| - | |
443 |
| - | |
444 |
| - | |
| 450 | + | |
| 451 | + | |
445 | 452 |
| |
446 | 453 |
| |
447 | 454 |
| |
| |||
451 | 458 |
| |
452 | 459 |
| |
453 | 460 |
| |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
454 | 465 |
| |
455 | 466 |
| |
456 | 467 |
| |
| |||
470 | 481 |
| |
471 | 482 |
| |
472 | 483 |
| |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
473 | 493 |
| |
474 | 494 |
| |
475 | 495 |
| |
|
Lines changed: 22 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
| 26 | + | |
26 | 27 |
| |
27 | 28 |
| |
28 | 29 |
| |
| |||
1519 | 1520 |
| |
1520 | 1521 |
| |
1521 | 1522 |
| |
1522 |
| - | |
1523 |
| - | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
1524 | 1526 |
| |
1525 | 1527 |
| |
1526 |
| - | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
1527 | 1531 |
| |
1528 |
| - | |
1529 |
| - | |
1530 |
| - | |
1531 |
| - | |
1532 |
| - | |
1533 |
| - | |
1534 |
| - | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
1535 | 1547 |
| |
1536 | 1548 |
| |
1537 | 1549 |
| |
|
Lines changed: 65 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1016 | 1016 |
| |
1017 | 1017 |
| |
1018 | 1018 |
| |
1019 |
| - | |
1020 |
| - | |
| 1019 | + | |
1021 | 1020 |
| |
1022 | 1021 |
| |
1023 | 1022 |
| |
| |||
2120 | 2119 |
| |
2121 | 2120 |
| |
2122 | 2121 |
| |
2123 |
| - | |
2124 |
| - | |
| 2122 | + | |
| 2123 | + | |
2125 | 2124 |
| |
2126 | 2125 |
| |
2127 | 2126 |
| |
| |||
2132 | 2131 |
| |
2133 | 2132 |
| |
2134 | 2133 |
| |
| 2134 | + | |
2135 | 2135 |
| |
2136 | 2136 |
| |
2137 | 2137 |
| |
| |||
2140 | 2140 |
| |
2141 | 2141 |
| |
2142 | 2142 |
| |
2143 |
| - | |
2144 |
| - | |
2145 |
| - | |
| 2143 | + | |
2146 | 2144 |
| |
2147 |
| - | |
2148 |
| - | |
2149 |
| - | |
2150 |
| - | |
2151 |
| - | |
2152 |
| - | |
2153 |
| - | |
| 2145 | + | |
| 2146 | + | |
2154 | 2147 |
| |
2155 | 2148 |
| |
2156 | 2149 |
| |
| |||
2161 | 2154 |
| |
2162 | 2155 |
| |
2163 | 2156 |
| |
2164 |
| - | |
| 2157 | + | |
| 2158 | + | |
2165 | 2159 |
| |
2166 | 2160 |
| |
2167 | 2161 |
| |
2168 |
| - | |
2169 |
| - | |
| 2162 | + | |
| 2163 | + | |
2170 | 2164 |
| |
2171 |
| - | |
2172 |
| - | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
2173 | 2180 |
| |
2174 | 2181 |
| |
2175 | 2182 |
| |
2176 | 2183 |
| |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
2177 | 2222 |
| |
2178 | 2223 |
| |
2179 | 2224 |
| |
| |||
2990 | 3035 |
| |
2991 | 3036 |
| |
2992 | 3037 |
| |
| 3038 | + | |
2993 | 3039 |
| |
2994 | 3040 |
| |
2995 | 3041 |
| |
|
Lines changed: 15 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3348 | 3348 |
| |
3349 | 3349 |
| |
3350 | 3350 |
| |
3351 |
| - | |
3352 |
| - | |
| 3351 | + | |
3353 | 3352 |
| |
3354 | 3353 |
| |
3355 | 3354 |
| |
| |||
3358 | 3357 |
| |
3359 | 3358 |
| |
3360 | 3359 |
| |
3361 |
| - | |
| 3360 | + | |
3362 | 3361 |
| |
3363 | 3362 |
| |
3364 | 3363 |
| |
3365 | 3364 |
| |
3366 | 3365 |
| |
3367 | 3366 |
| |
| 3367 | + | |
| 3368 | + | |
3368 | 3369 |
| |
3369 | 3370 |
| |
3370 | 3371 |
| |
| |||
3385 | 3386 |
| |
3386 | 3387 |
| |
3387 | 3388 |
| |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
3388 | 3400 |
| |
3389 | 3401 |
| |
3390 | 3402 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 |
| |
32 | 35 |
| |
33 | 36 |
| |
|
0 commit comments
Comments
(0)