postgresql/src/backend
David Rowley 475dbd0b71 Track a Bitmapset of non-pruned partitions in RelOptInfo
For partitioned tables with large numbers of partitions where queries are
able to prune all but a very small number of partitions, the time spent in
the planner looping over RelOptInfo.part_rels checking for non-NULL
RelOptInfos could become a large portion of the overall planning time.

Here we add a Bitmapset that records the non-pruned partitions.  This
allows us to more efficiently skip the pruned partitions by looping over
the Bitmapset.

This will cause a very slight slow down in cases where no or not many
partitions could be pruned, however, those cases are already slow to plan
anyway and the overhead of looping over the Bitmapset would be
unmeasurable when compared with the other tasks such as path creation for
a large number of partitions.

Reviewed-by: Amit Langote, Zhihong Yu
Discussion: https://postgr.es/m/CAApHDvqnPx6JnUuPwaf5ao38zczrAb9mxt9gj4U1EKFfd4AqLA@mail.gmail.com
2021-08-03 11:47:24 +12:00
..
access Run checkpointer and bgwriter in crash recovery. 2021-08-02 17:32:44 +12:00
bootstrap Remove misplaced comment from AuxiliaryProcessMain(). 2021-08-01 21:10:11 -07:00
catalog Remove redundant setting of pg_attribute.attcompression 2021-07-31 07:25:27 -04:00
commands Move InRecovery and standbyState global vars to xlogutils.c. 2021-07-31 09:50:26 +03:00
executor Fix oversight in commit 1ec7fca859. 2021-08-02 12:45:00 +09:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Clarify some comments making use of leetspeak term "up2date" 2021-07-28 10:31:24 +09:00
lib Fix typo in comment 2021-04-20 14:35:16 +02:00
libpq Add more sanity checks in SASL exchanges 2021-07-10 21:45:28 +09:00
main Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes Track a Bitmapset of non-pruned partitions in RelOptInfo 2021-08-03 11:47:24 +12:00
optimizer Track a Bitmapset of non-pruned partitions in RelOptInfo 2021-08-03 11:47:24 +12:00
parser Add support for SET ACCESS METHOD in ALTER TABLE 2021-07-28 10:10:44 +09:00
partitioning Track a Bitmapset of non-pruned partitions in RelOptInfo 2021-08-03 11:47:24 +12:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
postmaster Run checkpointer and bgwriter in crash recovery. 2021-08-02 17:32:44 +12:00
regex Fix performance issue in new regex match-all detection code. 2021-05-03 11:42:31 -04:00
replication Improve documentation for START_REPLICATION ... LOGICAL. 2021-07-30 15:12:20 -07:00
rewrite Use l*_node() family of functions where appropriate 2021-07-19 08:20:24 +02:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Error message refactoring 2021-06-27 09:41:16 +02:00
storage Run checkpointer and bgwriter in crash recovery. 2021-08-02 17:32:44 +12:00
tcop Use elog, not Assert, to report failure to provide an outer snapshot. 2021-07-31 11:50:14 -04:00
tsearch Improve various places that double the size of a buffer 2021-07-01 15:29:06 +12:00
utils Fix corner-case errors and loss of precision in numeric_power(). 2021-07-31 11:21:44 +01:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Translation updates 2021-05-10 14:36:21 +02:00