Re: SELECT DISTINCT chooses parallel seqscan instead of indexscan on huge table with 1000 partitions

From: Dimitrios Apostolou <jimis(at)gmx(dot)net>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: SELECT DISTINCT chooses parallel seqscan instead of indexscan on huge table with 1000 partitions
Date: 2024-05-13 14:07:19
Message-ID: 410018fd-1f9b-41b7-6257-89844b984564@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 14 May 2024, David Rowley wrote:

> That assumes the Append won't ever use > 1 worker per subnode, but
> that's not the case for your plan as the subnodes are "Parallel".
> That means all the workers could be working on the same subnode which
> could result in one group being split between 2 or more workers.

Didn't think of that, makes sense!

> Parallel Append can also run in a way that the Append child nodes will
> only get 1 worker each.

How can I tell which case it is, from the EXPLAIN output (for example
the output at [1]) ?

[1] https://www.postgresql.org/message-id/69077f15-4125-2d63-733f-21ce6eac4f01%40gmx.net

Dimitris

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zwettler Markus (OIZ) 2024-05-13 14:10:49 how to completely turn off statement error logging
Previous Message Dimitrios Apostolou 2024-05-13 13:52:42 Re: SELECT DISTINCT chooses parallel seqscan instead of indexscan on huge table with 1000 partitions