|
1 | 1 | /*------------------------------------------------------------------------- |
2 | 2 | * |
3 | 3 | * partprune.c |
4 | | - *Parses clauses attempting to match them up to partition keys of a |
5 | | - *given relation and generates a set of "pruning steps", which can be |
6 | | - *later "executed" either from the planner or the executor to determine |
7 | | - *the minimum set of partitions which match the given clauses. |
| 4 | + *Support for partition pruning during query planning |
| 5 | + * |
| 6 | + * This module implements partition pruning using the information contained in |
| 7 | + * table's partition descriptor and query clauses. |
| 8 | + * |
| 9 | + * During planning, clauses that can be matched to the table's partition key |
| 10 | + * are turned into a set of "pruning steps", which are then executed to |
| 11 | + * produce a set of partitions (as indexes of the RelOptInfo->part_rels array) |
| 12 | + * that satisfy the constraints in the step Partitions not in the set are said |
| 13 | + * to have been pruned. |
| 14 | + * |
| 15 | + * There are two kinds of pruning steps: a "base" pruning step, which contains |
| 16 | + * information extracted from one or more clauses that are matched to the |
| 17 | + * (possibly multi-column) partition key, such as the expressions whose values |
| 18 | + * to match against partition bounds and operator strategy to associate to |
| 19 | + * each expression. The other kind is a "combine" pruning step, which combines |
| 20 | + * the outputs of some other steps using the appropriate combination method. |
| 21 | + * All steps that are constructed are executed in succession such that for any |
| 22 | + * "combine" step, all of the steps whose output it depends on are executed |
| 23 | + * first and their ouput preserved. |
| 24 | + * |
| 25 | + * See gen_partprune_steps_internal() for more details on step generation. |
8 | 26 | * |
9 | 27 | * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group |
10 | 28 | * Portions Copyright (c) 1994, Regents of the University of California |
@@ -256,7 +274,8 @@ prune_append_rel_partitions(RelOptInfo *rel) |
256 | 274 | * get_matching_partitions |
257 | 275 | *Determine partitions that survive partition pruning |
258 | 276 | * |
259 | | - * Returns a Bitmapset of indexes of surviving partitions. |
| 277 | + * Returns a Bitmapset of the RelOptInfo->part_rels indexes of the surviving |
| 278 | + * partitions. |
260 | 279 | */ |
261 | 280 | Bitmapset* |
262 | 281 | get_matching_partitions(PartitionPruneContext*context,List*pruning_steps) |
|