postgresql/src/backend
Alvaro Herrera 297daa9d43
Refactor and cleanup runtime partition prune code a little
* Move the execution pruning initialization steps that are common
between both ExecInitAppend() and ExecInitMergeAppend() into a new
function ExecInitPartitionPruning() defined in execPartition.c.
Those steps include creation of a PartitionPruneState to be used for
all instances of pruning and determining the minimal set of child
subplans that need to be initialized by performing initial pruning if
needed, and finally adjusting the subplan_map arrays in the
PartitionPruneState to reflect the new set of subplans remaining
after initial pruning if it was indeed performed.
ExecCreatePartitionPruneState() is no longer exported out of
execPartition.c and has been renamed to CreatePartitionPruneState()
as a local sub-routine of ExecInitPartitionPruning().

* Likewise, ExecFindInitialMatchingSubPlans() that was in charge of
performing initial pruning no longer needs to be exported.  In fact,
since it would now have the same body as the more generally named
ExecFindMatchingSubPlans(), except differing in the value of
initial_prune passed to the common subroutine
find_matching_subplans_recurse(), it seems better to remove it and add
an initial_prune argument to ExecFindMatchingSubPlans().

* Add an ExprContext field to PartitionPruneContext to remove the
implicit assumption in the runtime pruning code that the ExprContext to
use to compute pruning expressions that need one can always rely on the
PlanState providing it.  A future patch will allow runtime pruning (at
least the initial pruning steps) to be performed without the
corresponding PlanState yet having been created, so this will help.

Author: Amit Langote <amitlangote09@gmail.com>
Discussion: https://postgr.es/m/CA+HiwqEYCpEqh2LMDOp9mT+4-QoVe8HgFMKBjntEMCTZLpcCCA@mail.gmail.com
2022-04-05 11:46:48 +02:00
..
access vacuumlazy.c: Further consolidate resource allocation. 2022-04-04 11:53:33 -07:00
bootstrap pg_upgrade: Preserve relfilenodes and tablespace OIDs. 2022-01-17 13:40:27 -05:00
catalog Adjust tuplesort API to have bitwise option flags 2022-04-04 22:24:59 +12:00
commands JSON_TABLE 2022-04-04 16:03:47 -04:00
executor Refactor and cleanup runtime partition prune code a little 2022-04-05 11:46:48 +02:00
foreign Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
jit SQL/JSON query functions 2022-03-29 16:57:13 -04:00
lib dshash: revise sequential scan support. 2022-04-04 14:32:52 -07:00
libpq Add system view pg_ident_file_mappings 2022-03-29 10:15:48 +09:00
main Fix collection of typos in the code and the documentation 2022-03-15 11:29:35 +09:00
nodes JSON_TABLE 2022-04-04 16:03:47 -04:00
optimizer Fix comments with "a expression" 2022-03-31 15:45:25 -04:00
parser JSON_TABLE 2022-04-04 16:03:47 -04:00
partitioning Refactor and cleanup runtime partition prune code a little 2022-04-05 11:46:48 +02:00
po
port Ensure that the argument of shmdt(2) is declared "void *". 2022-02-15 17:17:28 -05:00
postmaster pgstat: consistent function comment formatting. 2022-04-04 13:53:34 -07:00
regex Call pg_newlocale_from_collation() also with default collation 2022-01-20 09:50:18 +01:00
replication Improve the generation memory allocator 2022-04-04 20:53:13 +12:00
rewrite Add support for MERGE SQL command 2022-03-28 16:47:48 +02:00
snowball
statistics Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
storage Add new block-by-block strategy for CREATE DATABASE. 2022-03-29 11:48:36 -04:00
tcop Add support for MERGE SQL command 2022-03-28 16:47:48 +02:00
tsearch
utils pgstat: consistent function comment formatting. 2022-04-04 13:53:34 -07:00
.gitignore
common.mk
Makefile Server-side gzip compression. 2022-01-24 15:13:18 -05:00
nls.mk