Re: Problem about postponing gathering partial paths for topmost scan/join rel
Richard Guo <guofenglinux@gmail.com>
From: Richard Guo <guofenglinux@gmail.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-07-30T07:14:45Z
Lists: pgsql-hackers
Attachments
- v1-0001-Gather-partial-paths-for-subproblem-s-topmost-sca.patch (application/octet-stream) patch v1-0001
On Wed, Jul 28, 2021 at 3:42 PM Richard Guo <guofenglinux@gmail.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
Commits
-
Fix incorrect is-this-the-topmost-join tests in parallel planning.
- d8e34fa7a18f 16.0 landed
- a3699c599ced 15.0 landed
-
Postpone generate_gather_paths for topmost scan/join rel.
- 3f90ec8597c3 11.0 cited