Re: Problem about postponing gathering partial paths for topmost scan/join rel

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problem about postponing gathering partial paths for topmost scan/join rel
Date: 2021-07-30 07:14:45
Message-ID: CAMbWs4-bbPocLuRb2+tL-BRz_fEZAuj7ZS=QdcM7uCe_qtw2uA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 28, 2021 at 3:42 PM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:

> To fix this problem, I'm thinking we can leverage 'root->all_baserels'
> to tell if we are at the topmost scan/join rel, something like:
>
> --- a/src/backend/optimizer/path/allpaths.c
> +++ b/src/backend/optimizer/path/allpaths.c
> @@ -3041,7 +3041,7 @@ standard_join_search(PlannerInfo *root, int
> levels_needed, List *initial_rels)
> * partial paths. We'll do the same for the
> topmost scan/join rel
> * once we know the final targetlist (see
> grouping_planner).
> */
> - if (lev < levels_needed)
> + if (!bms_equal(rel->relids, root->all_baserels))
> generate_useful_gather_paths(root, rel,
> false);
>
>
> Any thoughts?
>

Attach a patch to include the fix described upthread. Would appreciate
any comments on this topic.

Thanks
Richard

Attachment Content-Type Size
v1-0001-Gather-partial-paths-for-subproblem-s-topmost-sca.patch application/octet-stream 2.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-07-30 07:22:19 Re: alter table set TABLE ACCESS METHOD
Previous Message Peter Geoghegan 2021-07-30 07:10:49 Re: A qsort template