expand-partprune-header-comment-2.patch

text/plain

Filename: expand-partprune-header-comment-2.patch
Type: text/plain
Part: 0
Message: Re: [HACKERS] Runtime Partition Pruning

Patch

Format: unified
File+
src/backend/partitioning/partprune.c 21 4
commit 28768290d8d9c58e76e2594a14d5b1f8465ba262
Author:     Alvaro Herrera <alvherre@alvh.no-ip.org>
AuthorDate: Sat Apr 7 08:44:12 2018 -0300
CommitDate: Sat Apr 7 09:20:58 2018 -0300

    Add some documentation to partprune.c
    
    Author: Amit Langote
    Discussion: https://postgr.es/m/CA+HiwqGzq4D6z=8R0AP+XhbTFCQ-4Ct+t2ekqjE9Fpm84_JUGg@mail.gmail.com

diff --git a/src/backend/partitioning/partprune.c b/src/backend/partitioning/partprune.c
index 959ee1643d..07b8057e3f 100644
--- a/src/backend/partitioning/partprune.c
+++ b/src/backend/partitioning/partprune.c
@@ -1,10 +1,27 @@
 /*-------------------------------------------------------------------------
  *
  * partprune.c
- *		Parses clauses attempting to match them up to partition keys of a
- *		given relation and generates a set of "pruning steps", which can be
- *		later "executed" either from the planner or the executor to determine
- *		the minimum set of partitions which match the given clauses.
+ *		Support for partition pruning during query planning
+ *
+ * This module implements partition pruning using the information contained in
+ * table's partition descriptor and query clauses.
+ *
+ * During planning, clauses that can be matched to the table's partition key
+ * are turned into a set of "pruning steps", which are then executed to
+ * produce a set of RTIs of partitions whose bounds satisfy the constraints in
+ * the step.  Partitions not in the set are said to have been pruned.
+ *
+ * There are two kinds of pruning steps: a "base" pruning step, which contains
+ * information extracted from one or more clauses that are matched to the
+ * (possibly multi-column) partition key, such as the expressions whose values
+ * to match against partition bounds and operator strategy to associate to
+ * each expression.  The other kind is a "combine" pruning step, which combines
+ * the outputs of some other steps using the appropriate combination method.
+ * All steps that are constructed are executed in succession such that for any
+ * "combine" step, all of the steps whose output it depends on are executed
+ * first and their ouput preserved.
+ *
+ * See gen_partprune_steps_internal() for more details on step generation.
  *
  * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California