From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow parallel DISTINCT
Date: Sun, 22 Aug 2021 11:31:35 +0000
Message-ID: <E1mHlhP-0005P0-8X@gemulon.postgresql.org> (raw)
Allow parallel DISTINCT
We've supported parallel aggregation since e06a38965. At the time, we
didn't quite get around to also adding parallel DISTINCT. So, let's do
that now.
This is implemented by introducing a two-phase DISTINCT. Phase 1 is
performed on parallel workers, rows are made distinct there either by
hashing or by sort/unique. The results from the parallel workers are
combined and the final distinct phase is performed serially to get rid of
any duplicate rows that appear due to combining rows for each of the
parallel workers.
Author: David Rowley
Reviewed-by: Zhihong Yu
Discussion: https://postgr.es/m/CAApHDvrjRxVKwQN0he79xS+9wyotFXL=RmoWqGGO2N45Farpgw@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/22c4e88ebff408acd52e212543a77158bde59e69
Modified Files
--------------
src/backend/optimizer/README | 1 +
src/backend/optimizer/plan/planner.c | 219 ++++++++++++++++++++++----
src/include/nodes/pathnodes.h | 1 +
src/test/regress/expected/select_distinct.out | 67 ++++++++
src/test/regress/sql/select_distinct.sql | 37 +++++
5 files changed, 292 insertions(+), 33 deletions(-)
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-committers@postgresql.org
Cc: drowley@postgresql.org
Subject: Re: pgsql: Allow parallel DISTINCT
In-Reply-To: <E1mHlhP-0005P0-8X@gemulon.postgresql.org>
References: <E1mHlhP-0005P0-8X@gemulon.postgresql.org>
* 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