Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit971d7dd

Browse files
committed
Document partprune.c a little better
Author: Amit LangoteReviewed-by: Álvaro Herrera, David RowleyDiscussion:https://postgr.es/m/CA+HiwqGzq4D6z=8R0AP+XhbTFCQ-4Ct+t2ekqjE9Fpm84_JUGg@mail.gmail.com
1 parent4f813c7 commit971d7dd

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

‎src/backend/partitioning/partprune.c

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
/*-------------------------------------------------------------------------
22
*
33
* 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.
826
*
927
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
1028
* Portions Copyright (c) 1994, Regents of the University of California
@@ -256,7 +274,8 @@ prune_append_rel_partitions(RelOptInfo *rel)
256274
* get_matching_partitions
257275
*Determine partitions that survive partition pruning
258276
*
259-
* Returns a Bitmapset of indexes of surviving partitions.
277+
* Returns a Bitmapset of the RelOptInfo->part_rels indexes of the surviving
278+
* partitions.
260279
*/
261280
Bitmapset*
262281
get_matching_partitions(PartitionPruneContext*context,List*pruning_steps)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp