postgresql/src/tools
Robert Haas 7358abcc60 Store information about Append node consolidation in the final plan.
An extension (or core code) might want to reconstruct the planner's
decisions about whether and where to perform partitionwise joins from
the final plan. To do so, it must be possible to find all of the RTIs
of partitioned tables appearing in the plan. But when an AppendPath
or MergeAppendPath pulls up child paths from a subordinate AppendPath
or MergeAppendPath, the RTIs of the subordinate path do not appear
in the final plan, making this kind of reconstruction impossible.

To avoid this, propagate the RTI sets that would have been present
in the 'apprelids' field of the subordinate Append or MergeAppend
nodes that would have been created into the surviving Append or
MergeAppend node, using a new 'child_append_relid_sets' field for
that purpose. The value of this field is a list of Bitmapsets,
because each relation whose append-list was pulled up had its own
set of RTIs: just one, if it was a partitionwise scan, or more than
one, if it was a partitionwise join. Since our goal is to see where
partitionwise joins were done, it is essential to avoid losing the
information about how the RTIs were grouped in the pulled-up
relations.

This commit also updates pg_overexplain so that EXPLAIN (RANGE_TABLE)
will display the saved RTI sets.

Co-authored-by: Robert Haas <rhaas@postgresql.org>
Co-authored-by: Lukas Fittl <lukas@fittl.com>
Reviewed-by: Lukas Fittl <lukas@fittl.com>
Reviewed-by: Jakub Wartak <jakub.wartak@enterprisedb.com>
Reviewed-by: Greg Burd <greg@burd.me>
Reviewed-by: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Haibo Yan <tristan.yim@gmail.com>
Reviewed-by: Alexandra Wang <alexandra.wang.oss@gmail.com>
Discussion: http://postgr.es/m/CA+TgmoZ-Jh1T6QyWoCODMVQdhTUPYkaZjWztzP1En4=ZHoKPzw@mail.gmail.com
2026-02-10 17:55:59 -05:00
..
ci ci: Improve OpenBSD core dump backtrace handling. 2025-11-06 21:14:05 +13:00
editors Make Emacs perl-mode indent more like perltidy. 2019-01-13 11:32:31 -08:00
ifaddrs Update copyright for 2026 2026-01-01 13:24:10 -05:00
perlcheck Activate perlcritic InputOutput::RequireCheckedSyscalls and fix resulting warnings 2024-03-19 07:09:31 +01:00
pg_bsd_indent Update copyright for 2026 2026-01-01 13:24:10 -05:00
pginclude Update copyright for 2026 2026-01-01 13:24:10 -05:00
pgindent Store information about Append node consolidation in the final plan. 2026-02-10 17:55:59 -05:00
add_commit_links.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
ccsym
check_bison_recursion.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
copyright.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
darwin_sysroot Move darwin sysroot determination into separate file 2022-09-01 16:54:19 -07:00
find_badmacros
find_meson meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
find_static Fix trap in a few shell scripts 2022-09-20 18:50:16 +02:00
find_typedef
gen_export.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
gen_keywordlist.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
generate_editorconfig.py Add script to keep .editorconfig in sync with .gitattributes 2025-02-01 10:09:45 +01:00
git-external-diff Preserve information on use of git-external-diff 2018-05-24 23:45:31 +09:30
git_changelog Update copyright for 2026 2026-01-01 13:24:10 -05:00
install_files meson: make install_test_files more generic, rename to install_files 2023-03-23 21:20:18 -07:00
make_ctags Fix make_etags breakage on certain platforms. 2023-06-14 11:02:50 +09:00
make_etags Fix make_etags failure on Mac. 2023-02-15 09:52:42 +09:00
make_mkid
mark_pgdllimport.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
msvc_gendef.pl MSVC: Support building for AArch64. 2026-01-07 13:42:57 -06:00
PerfectHash.pm Update copyright for 2026 2026-01-01 13:24:10 -05:00
pgflex pgflex: propagate environment to flex subprocess 2025-06-30 12:24:48 +02:00
pgtest pgtest: fix spacing 2023-08-14 14:03:29 -04:00
rcgen meson: Add windows resource files 2022-10-05 09:56:05 -07:00
RELEASE_CHANGES Add reminder to create .abi-compliance-history. 2025-10-21 12:23:23 -05:00
testwrap Add 'make check-tests' behavior to the meson based builds 2025-11-21 17:12:22 -05:00
valgrind.supp Fix typos and inconsistencies in code and comments 2026-01-05 09:19:15 +09:00
version_stamp.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
win32tzlist.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00