forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite89a71f
committed
Pass InitPlan values to workers via Gather (Merge).
If a PARAM_EXEC parameter is used below a Gather (Merge) but the InitPlanthat computes it is attached to or above the Gather (Merge), force thevalue to be computed before starting parallelism and pass it down to allworkers. This allows us to use parallelism in cases where it previouslywould have had to be rejected as unsafe. We do - in this case - lose theoptimization that the value is only computed if it's actually used. Analternative strategy would be to have the first worker that needs the valuecompute it, but one downside of that approach is that we'd then need toselect a parallel-safe path to compute the parameter value; it couldn't forexample contain a Gather (Merge) node. At some point in the future, wemight want to consider both approaches.Independent of that consideration, there is a great deal more work thatcould be done to make more kinds of PARAM_EXEC parameters parallel-safe.This infrastructure could be used to allow a Gather (Merge) on the innerside of a nested loop (although that's not a very appealing plan) andcases where the InitPlan is attached below the Gather (Merge) could beaddressed as well using various techniques. But this is a good start.Amit Kapila, reviewed and revised by me. Reviewing and testing fromKuntal Ghosh, Haribabu Kommi, and Tushar Ahuja.Discussion:http://postgr.es/m/CAA4eK1LV0Y1AUV4cUCdC+sYOx0Z0-8NAJ2Pd9=UKsbQ5Sr7+JQ@mail.gmail.com1 parentff2d435 commite89a71f
File tree
17 files changed
+419
-23
lines changed- src
- backend
- commands
- executor
- nodes
- optimizer
- plan
- util
- include
- executor
- nodes
- test/regress
- expected
- sql
17 files changed
+419
-23
lines changedLines changed: 34 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
107 | 107 |
| |
108 | 108 |
| |
109 | 109 |
| |
| 110 | + | |
110 | 111 |
| |
111 | 112 |
| |
112 | 113 |
| |
| |||
1441 | 1442 |
| |
1442 | 1443 |
| |
1443 | 1444 |
| |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
1444 | 1450 |
| |
1445 | 1451 |
| |
1446 | 1452 |
| |
| |||
1463 | 1469 |
| |
1464 | 1470 |
| |
1465 | 1471 |
| |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
1466 | 1477 |
| |
1467 | 1478 |
| |
1468 | 1479 |
| |
| |||
2487 | 2498 |
| |
2488 | 2499 |
| |
2489 | 2500 |
| |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
2490 | 2524 |
| |
2491 | 2525 |
| |
2492 | 2526 |
| |
|
Lines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1926 | 1926 |
| |
1927 | 1927 |
| |
1928 | 1928 |
| |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
1929 | 1956 |
| |
1930 | 1957 |
| |
1931 | 1958 |
| |
|
0 commit comments
Comments
(0)