1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-04 20:11:56 +03:00

Revert "Move PartitionPruneInfo out of plan nodes into PlannedStmt"

This reverts commit ec38694894 and its fixup 589bb81649.

This change was intended to support query planning avoiding acquisition
of locks on partitions that were going to be pruned; however, the
overall project took a different direction at [1] and this bit is no
longer needed.  Put things back the way they were as agreed in [2], to
avoid unnecessary complexity.

Discussion: [1] https://postgr.es/m/4191508.1674157166@sss.pgh.pa.us
Discussion: [2] https://postgr.es/m/20230502175409.kcoirxczpdha26wt@alvherre.pgsql
This commit is contained in:
Alvaro Herrera
2023-05-04 12:09:59 +02:00
parent 919c486a27
commit 5472743d9e
16 changed files with 63 additions and 135 deletions

View File

@@ -623,7 +623,6 @@ typedef struct EState
* ExecRowMarks, or NULL if none */
List *es_rteperminfos; /* List of RTEPermissionInfo */
PlannedStmt *es_plannedstmt; /* link to top of plan tree */
List *es_part_prune_infos; /* PlannedStmt.partPruneInfos */
const char *es_sourceText; /* Source text from QueryDesc */
JunkFilter *es_junkFilter; /* top-level junk filter, if any */

View File

@@ -125,9 +125,6 @@ typedef struct PlannerGlobal
/* "flat" list of AppendRelInfos */
List *appendRelations;
/* List of PartitionPruneInfo contained in the plan */
List *partPruneInfos;
/* OIDs of relations the plan depends on */
List *relationOids;
@@ -547,9 +544,6 @@ struct PlannerInfo
/* Does this query modify any partition key columns? */
bool partColsUpdated;
/* PartitionPruneInfos added in this query's plan. */
List *partPruneInfos;
};

View File

@@ -70,9 +70,6 @@ typedef struct PlannedStmt
struct Plan *planTree; /* tree of Plan nodes */
List *partPruneInfos; /* List of PartitionPruneInfo contained in the
* plan */
List *rtable; /* list of RangeTblEntry nodes */
List *permInfos; /* list of RTEPermissionInfo nodes for rtable
@@ -276,8 +273,8 @@ typedef struct Append
*/
int first_partial_plan;
/* Index to PlannerInfo.partPruneInfos or -1 if no run-time pruning */
int part_prune_index;
/* Info for run-time subplan pruning; NULL if we're not doing that */
struct PartitionPruneInfo *part_prune_info;
} Append;
/* ----------------
@@ -311,8 +308,8 @@ typedef struct MergeAppend
/* NULLS FIRST/LAST directions */
bool *nullsFirst pg_node_attr(array_size(numCols));
/* Index to PlannerInfo.partPruneInfos or -1 if no run-time pruning */
int part_prune_index;
/* Info for run-time subplan pruning; NULL if we're not doing that */
struct PartitionPruneInfo *part_prune_info;
} MergeAppend;
/* ----------------
@@ -1414,8 +1411,6 @@ typedef struct PlanRowMark
* Then, since an Append-type node could have multiple partitioning
* hierarchies among its children, we have an unordered List of those Lists.
*
* root_parent_relids RelOptInfo.relids of the relation to which the parent
* plan node and this PartitionPruneInfo node belong
* prune_infos List of Lists containing PartitionedRelPruneInfo nodes,
* one sublist per run-time-prunable partition hierarchy
* appearing in the parent plan node's subplans.
@@ -1428,7 +1423,6 @@ typedef struct PartitionPruneInfo
pg_node_attr(no_equal, no_query_jumble)
NodeTag type;
Bitmapset *root_parent_relids;
List *prune_infos;
Bitmapset *other_subplans;
} PartitionPruneInfo;