Allow parallel query for prepared statements with generic plans.
Robert Haas <rhaas@postgresql.org>
Allow parallel query for prepared statements with generic plans. This was always intended to work, but due to an oversight in max_parallel_hazard_walker, it didn't. In testing, we missed the fact that it was only working for custom plans, where the parameter value has been substituted for the parameter itself early enough that everything worked. In a generic plan, the Param node survives and must be treated as parallel-safe. SerializeParamList provides for the transmission of parameter values to workers. Amit Kapila with help from Kuntal Ghosh. Some changes by me. Discussion: http://postgr.es/m/CAA4eK1+_BuZrmVCeua5Eqnm4Co9DAXdM5HPAOE2J19ePbR912Q@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/util/clauses.c | modified | +6 −2 |
| src/pl/plpgsql/src/pl_exec.c | modified | +5 −5 |
| src/test/regress/expected/select_parallel.out | modified | +20 −0 |
| src/test/regress/sql/select_parallel.sql | modified | +6 −0 |
Discussion
- Parallel safety for extern params 14 messages · 2017-10-13 → 2025-03-24