RefLib

Reference library for AI

Back

postgresql_16:3.12.3.5 Parallel Plan Tips

PostgreSQL 16 > The SQL Language > Parallel Query > Parallel Plans > Parallel Plan Tips

If a query that is expected to do so does not produce a parallel plan, you can try reducing (see guc-parallel-setup-cost) or (see guc-parallel-tuple-cost). Of course, this plan may turn out to be slower than the serial plan that the planner preferred, but this will not always be the case. If you don't get a parallel plan even with very small values of these settings (e.g., after setting them both to zero), there may be some reason why the query planner is unable to generate a parallel plan for your query. See (see postgresql_16:3.12.2) and (see postgresql_16:3.12.4) for information on why this may be the case.

When executing a parallel plan, you can use EXPLAIN (ANALYZE, VERBOSE) to display per-worker statistics for each plan node. This may be useful in determining whether the work is being evenly distributed between all plan nodes and more generally in understanding the performance characteristics of the plan.

Back