public inbox for [email protected]  
help / color / mirror / Atom feed
From: Dimitrios Apostolou <[email protected]>
To: David Rowley <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: [email protected]
Subject: Re: SELECT DISTINCT chooses parallel seqscan instead of indexscan on huge table with 1000 partitions
Date: Mon, 13 May 2024 16:07:19 +0200 (CEST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAApHDvoJHxrsgQm8cS=yWN2akxP=bLxuYNPCaXXWcmcG+_b1iw@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAApHDvqWfGdUpTUp9s7AZYSeh44aLEXoBQS7UcfKM0zKhTCkiQ@mail.gmail.com>
	<[email protected]>
	<CAApHDvoJHxrsgQm8cS=yWN2akxP=bLxuYNPCaXXWcmcG+_b1iw@mail.gmail.com>



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







view thread (17+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: SELECT DISTINCT chooses parallel seqscan instead of indexscan on huge table with 1000 partitions
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox