Commit 61c2e1a
committed
Improve access to parallel query from procedural languages.
In SQL, the ability to use parallel query was previous contingent on
fcache->readonly_func, which is only set for non-volatile functions;
but the volatility of a function has no bearing on whether queries
inside it can use parallelism. Remove that condition.
SPI_execute and SPI_execute_with_args always run the plan just once,
though not necessarily to completion. Given the changes in commit
691b8d5, it's sensible to pass
CURSOR_OPT_PARALLEL_OK here, so do that. This improves access to
parallelism for any caller that uses these functions to execute
queries. Such callers include plperl, plpython, pltcl, and plpgsql,
though it's not the case that they all use these functions
exclusively.
In plpgsql, allow parallel query for plain SELECT queries (as
opposed to PERFORM, which already worked) and for plain expressions
(which probably won't go through the executor at all, because they
will likely be simple expressions, but if they do then this helps).
Rafia Sabih and Robert Haas, reviewed by Dilip Kumar and Amit Kapila
Discussion: http://postgr.es/m/CAOGQiiMfJ+4SQwgG=6CVHWoisiU0+7jtXSuiyXBM3y=A=eJzmg@mail.gmail.com1 parent 8082bea commit 61c2e1a
File tree
3 files changed
+20
-16
lines changed- src
- backend/executor
- pl/plpgsql/src
3 files changed
+20
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
506 | | - | |
| 506 | + | |
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
| 317 | + | |
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| |||
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
461 | | - | |
| 461 | + | |
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
268 | | - | |
| 267 | + | |
269 | 268 | | |
270 | 269 | | |
271 | 270 | | |
| |||
1685 | 1684 | | |
1686 | 1685 | | |
1687 | 1686 | | |
1688 | | - | |
| 1687 | + | |
1689 | 1688 | | |
1690 | 1689 | | |
1691 | 1690 | | |
| |||
2238 | 2237 | | |
2239 | 2238 | | |
2240 | 2239 | | |
2241 | | - | |
| 2240 | + | |
2242 | 2241 | | |
2243 | 2242 | | |
2244 | 2243 | | |
| |||
3023 | 3022 | | |
3024 | 3023 | | |
3025 | 3024 | | |
3026 | | - | |
| 3025 | + | |
3027 | 3026 | | |
3028 | 3027 | | |
3029 | 3028 | | |
| |||
3627 | 3626 | | |
3628 | 3627 | | |
3629 | 3628 | | |
3630 | | - | |
| 3629 | + | |
3631 | 3630 | | |
3632 | 3631 | | |
3633 | 3632 | | |
| |||
5174 | 5173 | | |
5175 | 5174 | | |
5176 | 5175 | | |
5177 | | - | |
| 5176 | + | |
5178 | 5177 | | |
5179 | 5178 | | |
5180 | 5179 | | |
| |||
5187 | 5186 | | |
5188 | 5187 | | |
5189 | 5188 | | |
5190 | | - | |
| 5189 | + | |
5191 | 5190 | | |
5192 | 5191 | | |
5193 | 5192 | | |
| |||
5243 | 5242 | | |
5244 | 5243 | | |
5245 | 5244 | | |
5246 | | - | |
5247 | | - | |
| 5245 | + | |
5248 | 5246 | | |
5249 | 5247 | | |
5250 | 5248 | | |
5251 | 5249 | | |
5252 | 5250 | | |
5253 | | - | |
| 5251 | + | |
| 5252 | + | |
| 5253 | + | |
| 5254 | + | |
| 5255 | + | |
| 5256 | + | |
| 5257 | + | |
5254 | 5258 | | |
5255 | 5259 | | |
5256 | | - | |
5257 | | - | |
| 5260 | + | |
| 5261 | + | |
5258 | 5262 | | |
5259 | 5263 | | |
5260 | 5264 | | |
| |||
0 commit comments