Re: increased max_parallel_workers_per_gather results in fewer workers?

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Philip Semanchuk <philip(at)americanefficient(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: increased max_parallel_workers_per_gather results in fewer workers?
Date: 2020-06-04 08:56:04
Message-ID: 20200604085604.xvhr4earrplt73qv@development
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Jun 03, 2020 at 06:23:57PM -0400, Philip Semanchuk wrote:
>
> ...
>
>I then ran the EXPLAIN ANALYZE and got the same slow runtime (1473s) and 1 worker in the EXPLAIN ANALYZE output.
>
>
>> I guess you should show an explain analyze, specifically "Workers
>> Planned/Launched", maybe by linking to explain.depesz.com
>
>Out of an abundance of caution, our company has a policy of not pasting our plans to public servers. However, I can confirm that when I set max_parallel_workers_per_gather > 4 and the runtime increases, this is what’s in the EXPLAIN ANALYZE output:
>
> Workers Planned: 1
> Workers Launched: 1
>
>FWIW, the Planning Time reported in EXPLAIN ANALYZE output doesn’t vary significantly, only from 411-443ms, and the variation within that range correlates only very weakly with max_parallel_workers_per_gather.
>

Well, that policy is stupid and it makes it unnecessarily harder to
answer your questions. We really need to see the plans, it's much harder
to give you any advices without it. We can only speculate about what's
going on.

It's understandable there may be sensitive information in the plan
(parameter values, ...) but that can be sanitized before posting.

We need to see plans for the good and bad case, so that we can compare
them, look at the plan general shapes, costs, etc.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Magnus Hagander 2020-06-04 09:30:54 Re: increased max_parallel_workers_per_gather results in fewer workers?
Previous Message Luis Carril 2020-06-04 06:41:27 Re: increased max_parallel_workers_per_gather results in fewer workers?