postgresql/src/backend
Tom Lane 2f17b57017 Improve performance of adjust_appendrel_attrs_multilevel.
The present implementations of adjust_appendrel_attrs_multilevel and
its sibling adjust_child_relids_multilevel are very messy, because
they work by reconstructing the relids of the child's immediate
parent and then seeing if that's bms_equal to the relids of the
target parent.  Aside from being quite inefficient, this will not
work with planned future changes to make joinrels' relid sets
contain outer-join relids in addition to baserels.

The whole thing can be solved at a stroke by adding explicit parent
and top_parent links to child RelOptInfos, and making these functions
work with RelOptInfo pointers instead of relids.  Doing that is
simpler for most callers, too.

In my original version of this patch, I got rid of
RelOptInfo.top_parent_relids on the grounds that it was now redundant.
However, that adds a lot of code churn in places that otherwise would
not need changing, and arguably the extra indirection needed to fetch
top_parent->relids in those places costs something.  So this version
leaves that field in place.

Discussion: https://postgr.es/m/553080.1657481916@sss.pgh.pa.us
2022-08-18 12:36:16 -04:00
..
access Adjust assertion in XLogDecodeNextRecord. 2022-08-18 12:22:20 -04:00
backup Move basebackup code to new directory src/backend/backup 2022-08-10 14:03:23 -04:00
bootstrap Process session_preload_libraries within InitPostgres's transaction. 2022-07-25 10:27:43 -04:00
catalog Avoid using list_length() to test for empty list. 2022-08-17 11:12:35 -04:00
commands Fix subtly-incorrect matching of parent and child partitioned indexes. 2022-08-18 12:12:03 -04:00
executor Avoid using list_length() to test for empty list. 2022-08-17 11:12:35 -04:00
foreign Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
jit Improve performance of ORDER BY / DISTINCT aggregates 2022-08-02 23:11:45 +12:00
lib Fix lock assertions in dshash.c. 2022-07-11 16:43:29 +12:00
libpq mstcpip.h is not missing on MinGW. 2022-08-18 16:31:11 +12:00
main Fix outdated --help message for postgres -f 2022-08-15 13:36:36 +09:00
nodes Remove redundant spaces in _outA_Expr() output 2022-08-15 12:43:52 +02:00
optimizer Improve performance of adjust_appendrel_attrs_multilevel. 2022-08-18 12:36:16 -04:00
parser Catch stack overflow when recursing in transformFromClauseItem(). 2022-08-13 15:21:28 -04:00
partitioning Improve performance of adjust_appendrel_attrs_multilevel. 2022-08-18 12:36:16 -04:00
po NLS: Put list of available languages into LINGUAS files 2022-07-13 08:19:17 +02:00
port Remove configure probes for sys/ipc.h, sys/sem.h, sys/shm.h. 2022-08-14 00:09:47 +12:00
postmaster Remove HAVE_UNIX_SOCKETS. 2022-08-14 08:46:53 +12:00
regex Remove redundant null pointer checks before free() 2022-07-03 11:47:15 +02:00
replication Refer to replication origin roident as "ID" in user facing messages and docs 2022-08-18 08:57:13 +07:00
rewrite Avoid using list_length() to test for empty list. 2022-08-17 11:12:35 -04:00
snowball Move snowball_create.sql creation into perl file 2022-07-18 12:24:27 -07:00
statistics Avoid using list_length() to test for empty list. 2022-08-17 11:12:35 -04:00
storage When using the WAL-logged CREATE DATABASE strategy, bulk extend. 2022-08-18 11:26:34 -04:00
tcop Remove configure probe for sys/resource.h and refactor. 2022-08-14 00:09:47 +12:00
tsearch Invent qsort_interruptible(). 2022-07-12 16:30:36 -04:00
utils Avoid using list_length() to test for empty list. 2022-08-17 11:12:35 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Move basebackup code to new directory src/backend/backup 2022-08-10 14:03:23 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk NLS: Put list of available languages into LINGUAS files 2022-07-13 08:19:17 +02:00