Re: Allow parallel DISTINCT

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Allow parallel DISTINCT
Date: 2021-08-17 08:13:23
Message-ID: CALNJ-vTFGQ8Dse3W=Up1eSgQTuH=z_Nyt-E_i0Og6y1wQ+Fg5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 16, 2021 at 10:07 PM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:

> On Wed, 11 Aug 2021 at 16:51, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
> > The patch is just some plumbing work to connect all the correct paths
> > up to make it work. It's all fairly trivial.
>
> I looked at this patch again and realise that it could be done a bit
> better. For example, the previous version set the distinct_rel's FDW
> fields twice, once when making the serial paths and once when
> finalizing the partial paths.
>
> I've now added two new functions; create_final_distinct_paths and
> create_partial_distinct_paths. The responsibility of
> create_distinct_paths has changed. Instead of it creating the
> non-parallel DISTINCT paths, it calls the two new functions and also
> takes charge of calling the create_upper_paths_hook for
> UPPERREL_DISTINCT plus the FDW GetForeignUpperPaths() call. I think
> this is nicer as I'd previously added a new parameter to
> create_distinct_paths() so I could tell it not to call the hook as I
> didn't want to call that twice on the same relation as it would no
> doubt result in some plugin just creating the same paths again.
>
> I've also changed my mind about the previous choice I'd made not to
> call GetForeignUpperPaths for the UPPERREL_PARTIAL_DISTINCT. I now
> think that's ok.
>
> I think this is a fairly trivial patch that just does a bit of wiring
> up of paths. Unless anyone has anything to say about it in the next
> few days, I'll be looking at it again with intensions to push it.
>
> David
>
>
> Hi, David:
Can you attach updated patch so that we know more detail about the two new
functions; create_final_distinct_paths and
create_partial_distinct_paths ?

Thanks

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message tanghy.fnst@fujitsu.com 2021-08-17 08:21:41 RE: Skipping logical replication transactions on subscriber side
Previous Message Michael Paquier 2021-08-17 08:04:44 Re: Fix uninitialized variable access (src/backend/utils/mmgr/freepage.c)