Debug DB parallel worker pool sharing issues with CTE on production
There seems to be some issues with parallel workers sharing when several
parallel heavy queries are concatenated using UNION ALL
while using
common table expressions. The planner allocates optimal number of
workers, but during execution, fewer are actually run, sometimes even 0,
causing the query to be executed sequentially, but with the parallel
overheads. The performance is abysmal then.
The initial exploratory modification of planner parameters have shown no
obvious ways to fix this. Also, this seems somewhat random, so the run
times fluctuate badly and so it has to be solved for these queries to be
used.
Author: Radko Krkoš krkos@cesnet.cz