mirror of
https://github.com/postgres/postgres.git
synced 2025-08-19 23:22:23 +03:00
Improve run-time partition pruning to handle any stable expression.
The initial coding of the run-time-pruning feature only coped with cases where the partition key(s) are compared to Params. That is a bit silly; we can allow it to work with any non-Var-containing stable expression, as long as we take special care with expressions containing PARAM_EXEC Params. The code is hardly any longer this way, and it's considerably clearer (IMO at least). Per gripe from Pavel Stehule. David Rowley, whacked around a bit by me Discussion: https://postgr.es/m/CAFj8pRBjrufA3ocDm8o4LPGNye9Y+pm1b9kCwode4X04CULG3g@mail.gmail.com
This commit is contained in:
@@ -1597,11 +1597,17 @@ typedef struct PartitionPruneInfo
|
||||
List *pruning_steps; /* List of PartitionPruneStep */
|
||||
Bitmapset *present_parts; /* Indexes of all partitions which subnodes
|
||||
* are present for. */
|
||||
int nparts; /* The length of the following two arrays */
|
||||
int nparts; /* Length of subnode_map[] and subpart_map[] */
|
||||
int nexprs; /* Length of hasexecparam[] */
|
||||
int *subnode_map; /* subnode index by partition id, or -1 */
|
||||
int *subpart_map; /* subpart index by partition id, or -1 */
|
||||
Bitmapset *extparams; /* All external paramids seen in prunesteps */
|
||||
Bitmapset *execparams; /* All exec paramids seen in prunesteps */
|
||||
bool *hasexecparam; /* true if corresponding pruning_step contains
|
||||
* any PARAM_EXEC Params. */
|
||||
bool do_initial_prune; /* true if pruning should be performed
|
||||
* during executor startup. */
|
||||
bool do_exec_prune; /* true if pruning should be performed during
|
||||
* executor run. */
|
||||
Bitmapset *execparamids; /* All PARAM_EXEC Param IDs in pruning_steps */
|
||||
} PartitionPruneInfo;
|
||||
|
||||
#endif /* PRIMNODES_H */
|
||||
|
Reference in New Issue
Block a user