From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-general@postgresql.org
Subject: Re: Using distinct in an aggregate prevents parallel execution?
Date: Wed, 06 Jun 2018 10:32:27 -0400
Message-ID: <6457.1528295547@sss.pgh.pa.us> (raw)
In-Reply-To: <pf8kli$i7a$1@blaine.gmane.org>
References: <pf8kli$i7a$1@blaine.gmane.org>
Thomas Kellerer <spam_eater@gmx.net> writes:
> Is this a known limitation?
Yes, unless somebody has done radical restructuring of the aggregation
code while I wasn't looking.
agg(DISTINCT ...) is currently implemented inside the Agg plan node,
so it's an indivisible black box to everything else. That was a
simple, minimum-code-footprint method for implementing the feature
back when; but it's got lots of drawbacks, and one is that there's
no reasonable way to parallelize.
I'd anticipate that before we could even start to think of parallelizing,
we'd have to split out the distinct-ification processing into a separate
plan node.
agg(... ORDER BY ...) has got the same problem, and it'd likely be
advisable to fix that at the same time.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, spam_eater@gmx.net
Subject: Re: Using distinct in an aggregate prevents parallel execution?
In-Reply-To: <6457.1528295547@sss.pgh.pa.us>
References: <pf8kli$i7a$1@blaine.gmane.org> <6457.1528295547@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox