Re: increased max_parallel_workers_per_gather results in fewer workers?

2020-06-03 Thread Luis Carril
Hi, on top of the settings that Sebastian suggested, you can also try disabling the participation of the leader (i.e. the main backend process for your connection) in the distribution of the parallel workload: SET parallel_leader_participation TO false Depending on your workload the leader

Re: increased max_parallel_workers_per_gather results in fewer workers?

2020-06-03 Thread Sebastian Dressler
Hi Philip, > On 4. Jun 2020, at 00:23, Philip Semanchuk > wrote: > >> 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 publi

Re: increased max_parallel_workers_per_gather results in fewer workers?

2020-06-03 Thread Justin Pryzby
On Wed, Jun 03, 2020 at 06:23:57PM -0400, Philip Semanchuk wrote: > > On Jun 3, 2020, at 5:15 PM, Justin Pryzby wrote: > > What version postgres ? > > This is AWS’ version of Postgres 11.6 (“Aurora”) which of course might make a > difference. > > I guess you should show an explain analyze, spec

Re: increased max_parallel_workers_per_gather results in fewer workers?

2020-06-03 Thread Philip Semanchuk
> On Jun 3, 2020, at 5:15 PM, Justin Pryzby wrote: > > On Wed, Jun 03, 2020 at 04:04:13PM -0400, Philip Semanchuk wrote: >> Can anyone help me understand why this happens, or where I might look for >> clues? > > What version postgres ? Sorry, I should have posted that in my initial email.

Re: increased max_parallel_workers_per_gather results in fewer workers?

2020-06-03 Thread Justin Pryzby
On Wed, Jun 03, 2020 at 04:04:13PM -0400, Philip Semanchuk wrote: > Can anyone help me understand why this happens, or where I might look for > clues? What version postgres ? Can you reproduce if you do: ALTER SYSTEM SET max_parallel_workers_per_gather=0; SELECT pg_reload_conf(); .. and then wi

increased max_parallel_workers_per_gather results in fewer workers?

2020-06-03 Thread Philip Semanchuk
Hi all, I’ve been experimenting with some performance tuning on a particular query, and I observed a result that I don’t understand. I’ve been setting max_parallel_workers_per_gather to values the range 1-6 and then running EXPLAIN ANALYZE to see how much benefit we get from more parallelizat

Re: When to use PARTITION BY HASH?

2020-06-03 Thread Justin Pryzby
On Wed, Jun 03, 2020 at 09:45:48AM +0200, Oleksandr Shulgin wrote: > I see. So it works with low cardinality in the partitioned column. With > high cardinality an index scan on an unpartitioned table would be > preferable I guess. > > The documentation page I've linked only contains examples aro

Re: When to use PARTITION BY HASH?

2020-06-03 Thread Oleksandr Shulgin
On Tue, Jun 2, 2020 at 7:33 PM Justin Pryzby wrote: > > To: pgsql-gene...@lists.postgresql.org, > pgsql-performance@lists.postgresql.org > > Please don't cross post to multiple lists. > > On Tue, Jun 02, 2020 at 07:17:11PM +0200, Oleksandr Shulgin wrote: > > I was reading up on declarative partit