forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit556f7b7
committed
Simplify executor's determination of whether to use parallelism.
Our parallel-mode code only works when we are executing a queryin full, so ExecutePlan must disable parallel mode when it isasked to do partial execution. The previous logic for thisinvolved passing down a flag (variously named execute_once orrun_once) from callers of ExecutorRun or PortalRun. This isovercomplicated, and unsurprisingly some of the callers didn'tget it right, since it requires keeping state that not all ofthem have handy; not to mention that the requirements for it wereundocumented. That led to assertion failures in some cornercases. The only state we really need for this is the existingQueryDesc.already_executed flag, so let's just put all theresponsibility in ExecutePlan. (It could have been done inExecutorRun too, leading to a slightly shorter patch -- but ifthere's ever more than one caller of ExecutePlan, it seems betterto have this logic in the subroutine than the callers.)This makes those ExecutorRun/PortalRun parameters unnecessary.In master it seems okay to just remove them, returning theAPI for those functions to what it was before parallelism.Such an API break is clearly not okay in stable branches,but for them we can just leave the parameters in place afterdocumenting that they do nothing.Per report from Yugo Nagata, who also reviewed and testedthis patch. Back-patch to all supported branches.Discussion:https://postgr.es/m/20241206062549.710dc01cf91224809dd6c0e1@sraoss.co.jp1 parentbb93b33 commit556f7b7
File tree
5 files changed
+29
-39
lines changed- src
- backend
- executor
- tcop
- include
- executor
- utils
5 files changed
+29
-39
lines changedLines changed: 21 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
75 | 75 |
| |
76 | 76 |
| |
77 | 77 |
| |
78 |
| - | |
79 |
| - | |
| 78 | + | |
80 | 79 |
| |
81 | 80 |
| |
82 | 81 |
| |
83 | 82 |
| |
84 |
| - | |
85 |
| - | |
| 83 | + | |
86 | 84 |
| |
87 | 85 |
| |
88 | 86 |
| |
| |||
283 | 281 |
| |
284 | 282 |
| |
285 | 283 |
| |
| 284 | + | |
| 285 | + | |
| 286 | + | |
286 | 287 |
| |
287 | 288 |
| |
288 | 289 |
| |
| |||
357 | 358 |
| |
358 | 359 |
| |
359 | 360 |
| |
360 |
| - | |
361 |
| - | |
362 |
| - | |
363 |
| - | |
364 |
| - | |
365 |
| - | |
366 |
| - | |
367 |
| - | |
| 361 | + | |
368 | 362 |
| |
369 | 363 |
| |
370 | 364 |
| |
371 | 365 |
| |
372 |
| - | |
373 |
| - | |
374 |
| - | |
| 366 | + | |
375 | 367 |
| |
376 | 368 |
| |
377 | 369 |
| |
| |||
1600 | 1592 |
| |
1601 | 1593 |
| |
1602 | 1594 |
| |
1603 |
| - | |
1604 |
| - | |
1605 |
| - | |
1606 | 1595 |
| |
1607 | 1596 |
| |
1608 | 1597 |
| |
1609 |
| - | |
1610 |
| - | |
1611 |
| - | |
| 1598 | + | |
1612 | 1599 |
| |
1613 | 1600 |
| |
1614 | 1601 |
| |
1615 | 1602 |
| |
1616 |
| - | |
1617 |
| - | |
| 1603 | + | |
1618 | 1604 |
| |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
1619 | 1608 |
| |
1620 | 1609 |
| |
1621 | 1610 |
| |
| |||
1630 | 1619 |
| |
1631 | 1620 |
| |
1632 | 1621 |
| |
1633 |
| - | |
1634 |
| - | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
1635 | 1627 |
| |
1636 |
| - | |
| 1628 | + | |
1637 | 1629 |
| |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
1638 | 1633 |
| |
1639 | 1634 |
| |
1640 | 1635 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1278 | 1278 |
| |
1279 | 1279 |
| |
1280 | 1280 |
| |
1281 |
| - | |
| 1281 | + | |
1282 | 1282 |
| |
1283 | 1283 |
| |
1284 | 1284 |
| |
| |||
2255 | 2255 |
| |
2256 | 2256 |
| |
2257 | 2257 |
| |
2258 |
| - | |
| 2258 | + | |
2259 | 2259 |
| |
2260 | 2260 |
| |
2261 | 2261 |
| |
|
Lines changed: 4 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
670 | 670 |
| |
671 | 671 |
| |
672 | 672 |
| |
| 673 | + | |
| 674 | + | |
673 | 675 |
| |
674 | 676 |
| |
675 | 677 |
| |
| |||
714 | 716 |
| |
715 | 717 |
| |
716 | 718 |
| |
717 |
| - | |
718 |
| - | |
719 |
| - | |
720 |
| - | |
721 | 719 |
| |
722 | 720 |
| |
723 | 721 |
| |
| |||
922 | 920 |
| |
923 | 921 |
| |
924 | 922 |
| |
925 |
| - | |
| 923 | + | |
926 | 924 |
| |
927 | 925 |
| |
928 | 926 |
| |
| |||
962 | 960 |
| |
963 | 961 |
| |
964 | 962 |
| |
965 |
| - | |
| 963 | + | |
966 | 964 |
| |
967 | 965 |
| |
968 | 966 |
| |
| |||
1406 | 1404 |
| |
1407 | 1405 |
| |
1408 | 1406 |
| |
1409 |
| - | |
1410 |
| - | |
1411 |
| - | |
1412 | 1407 |
| |
1413 | 1408 |
| |
1414 | 1409 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
51 |
| - | |
| 51 | + | |
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
145 | 145 |
| |
146 | 146 |
| |
147 | 147 |
| |
148 |
| - | |
| 148 | + | |
149 | 149 |
| |
150 | 150 |
| |
151 | 151 |
| |
|
0 commit comments
Comments
(0)