@@ -11,7 +11,7 @@ index f27e458482..0c62191904 100644
11
11
auto_explain \
12
12
bloom \
13
13
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
14
- index 69821c4631..f1fd5f93c5 100644
14
+ index 70551522da..958529fbab 100644
15
15
--- a/src/backend/commands/explain.c
16
16
+++ b/src/backend/commands/explain.c
17
17
@@ -24,6 +24,7 @@
@@ -35,7 +35,7 @@ index 69821c4631..f1fd5f93c5 100644
35
35
36
36
/* OR-able flags for ExplainXMLTag() */
37
37
#define X_OPENING 0
38
- @@ -670 ,6 +677 ,10 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
38
+ @@ -676 ,6 +683 ,10 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
39
39
ExplainPropertyFloat("Execution Time", "ms", 1000.0 * totaltime, 3,
40
40
es);
41
41
@@ -46,7 +46,7 @@ index 69821c4631..f1fd5f93c5 100644
46
46
ExplainCloseGroup("Query", NULL, true, es);
47
47
}
48
48
49
- @@ -1652 ,6 +1663 ,9 @@ ExplainNode(PlanState *planstate, List *ancestors,
49
+ @@ -1658 ,6 +1669 ,9 @@ ExplainNode(PlanState *planstate, List *ancestors,
50
50
}
51
51
}
52
52
@@ -57,47 +57,47 @@ index 69821c4631..f1fd5f93c5 100644
57
57
if (es->format == EXPLAIN_FORMAT_TEXT)
58
58
appendStringInfoChar(es->str, '\n');
59
59
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
60
- index 5769536c6a..8aae9d5039 100644
60
+ index a106a2cdf1..7150dccb4d 100644
61
61
--- a/src/backend/nodes/copyfuncs.c
62
62
+++ b/src/backend/nodes/copyfuncs.c
63
- @@ -129 ,6 +129 ,7 @@ CopyPlanFields(const Plan *from, Plan *newnode)
63
+ @@ -132 ,6 +132 ,7 @@ CopyPlanFields(const Plan *from, Plan *newnode)
64
64
COPY_NODE_FIELD(initPlan);
65
65
COPY_BITMAPSET_FIELD(extParam);
66
66
COPY_BITMAPSET_FIELD(allParam);
67
- + COPY_NODE_FIELD(private );
67
+ + COPY_NODE_FIELD(ext_nodes );
68
68
}
69
69
70
70
/*
71
71
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
72
- index da212d9ddf..78dc137df8 100644
72
+ index 0df9be1608..678e1f050f 100644
73
73
--- a/src/backend/nodes/outfuncs.c
74
74
+++ b/src/backend/nodes/outfuncs.c
75
75
@@ -342,6 +342,7 @@ _outPlanInfo(StringInfo str, const Plan *node)
76
76
WRITE_NODE_FIELD(initPlan);
77
77
WRITE_BITMAPSET_FIELD(extParam);
78
78
WRITE_BITMAPSET_FIELD(allParam);
79
- + /*WRITE_NODE_FIELD(private ); */
79
+ + /*WRITE_NODE_FIELD(ext_nodes ); */
80
80
}
81
81
82
82
/*
83
83
diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c
84
- index 4c537c30e0..40b1ce29de 100644
84
+ index eaa51c5c06..6ad8b78c7d 100644
85
85
--- a/src/backend/nodes/readfuncs.c
86
86
+++ b/src/backend/nodes/readfuncs.c
87
87
@@ -1628,6 +1628,11 @@ ReadCommonPlan(Plan *local_node)
88
88
READ_NODE_FIELD(initPlan);
89
89
READ_BITMAPSET_FIELD(extParam);
90
90
READ_BITMAPSET_FIELD(allParam);
91
- + local_node->private = NIL;
92
- + /* READ_NODE_FIELD(private );
91
+ + local_node->ext_nodes = NIL;
92
+ + /* READ_NODE_FIELD(ext_nodes );
93
93
+ * Don't serialize this field. It is required to serialize RestrictInfo and
94
94
+ * EqualenceClass.
95
95
+ */
96
96
}
97
97
98
98
/*
99
99
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
100
- index 30c8595f76..18699564b3 100644
100
+ index 006f91f0a8..ef9c8ec581 100644
101
101
--- a/src/backend/optimizer/path/costsize.c
102
102
+++ b/src/backend/optimizer/path/costsize.c
103
103
@@ -98,6 +98,11 @@
@@ -120,7 +120,7 @@ index 30c8595f76..18699564b3 100644
120
120
121
121
122
122
/*
123
- @@ -4905 ,6 +4909 ,58 @@ approx_tuple_count(PlannerInfo *root, JoinPath *path, List *quals)
123
+ @@ -4911 ,6 +4915 ,58 @@ approx_tuple_count(PlannerInfo *root, JoinPath *path, List *quals)
124
124
}
125
125
126
126
@@ -179,7 +179,7 @@ index 30c8595f76..18699564b3 100644
179
179
/*
180
180
* set_baserel_size_estimates
181
181
* Set the size estimates for the given base relation.
182
- @@ -4921 ,19 +4977 ,10 @@ approx_tuple_count(PlannerInfo *root, JoinPath *path, List *quals)
182
+ @@ -4927 ,19 +4983 ,10 @@ approx_tuple_count(PlannerInfo *root, JoinPath *path, List *quals)
183
183
void
184
184
set_baserel_size_estimates(PlannerInfo *root, RelOptInfo *rel)
185
185
{
@@ -200,7 +200,7 @@ index 30c8595f76..18699564b3 100644
200
200
201
201
cost_qual_eval(&rel->baserestrictcost, rel->baserestrictinfo, root);
202
202
203
- @@ -4944 ,13 +4991 ,33 @@ set_baserel_size_estimates(PlannerInfo *root, RelOptInfo *rel)
203
+ @@ -4950 ,13 +4997 ,33 @@ set_baserel_size_estimates(PlannerInfo *root, RelOptInfo *rel)
204
204
* get_parameterized_baserel_size
205
205
* Make a size estimate for a parameterized scan of a base relation.
206
206
*
@@ -236,7 +236,7 @@ index 30c8595f76..18699564b3 100644
236
236
{
237
237
List *allclauses;
238
238
double nrows;
239
- @@ -4979 ,6 +5046 ,36 @@ get_parameterized_baserel_size(PlannerInfo *root, RelOptInfo *rel,
239
+ @@ -4985 ,6 +5052 ,36 @@ get_parameterized_baserel_size(PlannerInfo *root, RelOptInfo *rel,
240
240
* set_joinrel_size_estimates
241
241
* Set the size estimates for the given join relation.
242
242
*
@@ -273,7 +273,7 @@ index 30c8595f76..18699564b3 100644
273
273
* The rel's targetlist must have been constructed already, and a
274
274
* restriction clause list that matches the given component rels must
275
275
* be provided.
276
- @@ -4998 ,11 +5095 ,11 @@ get_parameterized_baserel_size(PlannerInfo *root, RelOptInfo *rel,
276
+ @@ -5004 ,11 +5101 ,11 @@ get_parameterized_baserel_size(PlannerInfo *root, RelOptInfo *rel,
277
277
* build_joinrel_tlist, and baserestrictcost is not used for join rels.
278
278
*/
279
279
void
@@ -290,7 +290,7 @@ index 30c8595f76..18699564b3 100644
290
290
{
291
291
rel->rows = calc_joinrel_size_estimate(root,
292
292
rel,
293
- @@ -5018 ,6 +5115 ,35 @@ set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel,
293
+ @@ -5024 ,6 +5121 ,35 @@ set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel,
294
294
* get_parameterized_joinrel_size
295
295
* Make a size estimate for a parameterized scan of a join relation.
296
296
*
@@ -326,7 +326,7 @@ index 30c8595f76..18699564b3 100644
326
326
* 'rel' is the joinrel under consideration.
327
327
* 'outer_path', 'inner_path' are (probably also parameterized) Paths that
328
328
* produce the relations being joined.
329
- @@ -5030 ,11 +5156 ,11 @@ set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel,
329
+ @@ -5036 ,11 +5162 ,11 @@ set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel,
330
330
* set_joinrel_size_estimates must have been applied already.
331
331
*/
332
332
double
@@ -343,7 +343,7 @@ index 30c8595f76..18699564b3 100644
343
343
{
344
344
double nrows;
345
345
346
- @@ -5750 ,7 +5876 ,7 @@ set_foreign_size_estimates(PlannerInfo *root, RelOptInfo *rel)
346
+ @@ -5756 ,7 +5882 ,7 @@ set_foreign_size_estimates(PlannerInfo *root, RelOptInfo *rel)
347
347
/* Should only be applied to base relations */
348
348
Assert(rel->relid > 0);
349
349
@@ -352,7 +352,7 @@ index 30c8595f76..18699564b3 100644
352
352
353
353
cost_qual_eval(&rel->baserestrictcost, rel->baserestrictinfo, root);
354
354
355
- @@ -6036 ,7 +6162 ,7 @@ page_size(double tuples, int width)
355
+ @@ -6042 ,7 +6168 ,7 @@ page_size(double tuples, int width)
356
356
* Estimate the fraction of the work that each worker will do given the
357
357
* number of workers budgeted for the path.
358
358
*/
@@ -362,7 +362,7 @@ index 30c8595f76..18699564b3 100644
362
362
{
363
363
double parallel_divisor = path->parallel_workers;
364
364
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
365
- index 5658f24323..3bbfa3c1b5 100644
365
+ index 0ed858f305..9d4a6c5903 100644
366
366
--- a/src/backend/optimizer/plan/createplan.c
367
367
+++ b/src/backend/optimizer/plan/createplan.c
368
368
@@ -71,6 +71,7 @@
@@ -373,7 +373,7 @@ index 5658f24323..3bbfa3c1b5 100644
373
373
374
374
static Plan *create_plan_recurse(PlannerInfo *root, Path *best_path,
375
375
int flags);
376
- @@ -544 ,6 +545 ,10 @@ create_plan_recurse(PlannerInfo *root, Path *best_path, int flags)
376
+ @@ -545 ,6 +546 ,10 @@ create_plan_recurse(PlannerInfo *root, Path *best_path, int flags)
377
377
break;
378
378
}
379
379
@@ -384,11 +384,11 @@ index 5658f24323..3bbfa3c1b5 100644
384
384
return plan;
385
385
}
386
386
387
- @@ -5278 ,6 +5283 ,7 @@ copy_generic_path_info(Plan *dest, Path *src)
387
+ @@ -5323 ,6 +5328 ,7 @@ copy_generic_path_info(Plan *dest, Path *src)
388
388
dest->plan_width = src->pathtarget->width;
389
389
dest->parallel_aware = src->parallel_aware;
390
390
dest->parallel_safe = src->parallel_safe;
391
- + dest->private = NIL;
391
+ + dest->ext_nodes = NIL;
392
392
}
393
393
394
394
/*
@@ -474,14 +474,14 @@ index 70899e5430..34075cc87b 100644
474
474
extra->targetList);
475
475
476
476
diff --git a/src/backend/optimizer/util/relnode.c b/src/backend/optimizer/util/relnode.c
477
- index e105a4d5f1..d821ea63bd 100644
477
+ index e105a4d5f1..c5bcc9d1d1 100644
478
478
--- a/src/backend/optimizer/util/relnode.c
479
479
+++ b/src/backend/optimizer/util/relnode.c
480
480
@@ -258,6 +258,7 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptInfo *parent)
481
481
rel->all_partrels = NULL;
482
482
rel->partexprs = NULL;
483
483
rel->nullable_partexprs = NULL;
484
- + rel->private = NULL;
484
+ + rel->ext_nodes = NULL;
485
485
486
486
/*
487
487
* Pass assorted information down the inheritance hierarchy.
@@ -497,15 +497,15 @@ index e105a4d5f1..d821ea63bd 100644
497
497
joinrel->all_partrels = NULL;
498
498
joinrel->partexprs = NULL;
499
499
joinrel->nullable_partexprs = NULL;
500
- + joinrel->private = NULL;
500
+ + joinrel->ext_nodes = NULL;
501
501
502
502
/* Compute information relevant to the foreign relations. */
503
503
set_foreign_rel_properties(joinrel, outer_rel, inner_rel);
504
504
@@ -850,6 +851,7 @@ build_child_join_rel(PlannerInfo *root, RelOptInfo *outer_rel,
505
505
joinrel->all_partrels = NULL;
506
506
joinrel->partexprs = NULL;
507
507
joinrel->nullable_partexprs = NULL;
508
- + joinrel->private = NULL;
508
+ + joinrel->ext_nodes = NULL;
509
509
510
510
joinrel->top_parent_relids = bms_union(outer_rel->top_parent_relids,
511
511
inner_rel->top_parent_relids);
@@ -540,7 +540,7 @@ index e105a4d5f1..d821ea63bd 100644
540
540
541
541
return ppi;
542
542
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
543
- index 10895fb287..e81a6f6896 100644
543
+ index abe47dab86..0ef5f2c8da 100644
544
544
--- a/src/backend/utils/adt/selfuncs.c
545
545
+++ b/src/backend/utils/adt/selfuncs.c
546
546
@@ -143,6 +143,7 @@
@@ -596,10 +596,10 @@ index e94d9e49cf..49236ced77 100644
596
596
extern void ExplainQuery(ParseState *pstate, ExplainStmt *stmt,
597
597
ParamListInfo params, DestReceiver *dest);
598
598
diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h
599
- index 8ee40cc68c..d7bb9df67c 100644
599
+ index f16466a0df..c48d969ba8 100644
600
600
--- a/src/include/nodes/pathnodes.h
601
601
+++ b/src/include/nodes/pathnodes.h
602
- @@ -755 ,6 +755 ,10 @@ typedef struct RelOptInfo
602
+ @@ -756 ,6 +756 ,10 @@ typedef struct RelOptInfo
603
603
Relids top_parent_relids; /* Relids of topmost parents (if "other"
604
604
* rel) */
605
605
@@ -610,18 +610,22 @@ index 8ee40cc68c..d7bb9df67c 100644
610
610
/* used for partitioned relations: */
611
611
PartitionScheme part_scheme; /* Partitioning scheme */
612
612
int nparts; /* Number of partitions; -1 if not yet set; in
613
- @@ -769 ,7 +773,9 @@ typedef struct RelOptInfo
613
+ @@ -770 ,7 +774,13 @@ typedef struct RelOptInfo
614
614
Relids all_partrels; /* Relids set of all partition relids */
615
615
List **partexprs; /* Non-nullable partition key expressions */
616
616
List **nullable_partexprs; /* Nullable partition key expressions */
617
617
- } RelOptInfo;
618
618
+
619
- + List *private;
619
+ + /*
620
+ + * At this list an extension can add additional nodes to pass an info along
621
+ + * the planning and executing stages.
622
+ + */
623
+ + List *ext_nodes;
620
624
+ } RelOptInfo;
621
625
622
626
/*
623
627
* Is given relation partitioned?
624
- @@ -1137 ,6 +1143 ,10 @@ typedef struct ParamPathInfo
628
+ @@ -1138 ,6 +1148 ,10 @@ typedef struct ParamPathInfo
625
629
Relids ppi_req_outer; /* rels supplying parameters used by path */
626
630
double ppi_rows; /* estimated number of result tuples */
627
631
List *ppi_clauses; /* join clauses available from outer rels */
@@ -633,16 +637,19 @@ index 8ee40cc68c..d7bb9df67c 100644
633
637
634
638
635
639
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
636
- index 5ddf947971..fe9bda387a 100644
640
+ index 9ac4d9af12..6e20cd28c8 100644
637
641
--- a/src/include/nodes/plannodes.h
638
642
+++ b/src/include/nodes/plannodes.h
639
- @@ -158,6 +158,9 @@ typedef struct Plan
643
+ @@ -158,6 +158,12 @@ typedef struct Plan
640
644
*/
641
645
Bitmapset *extParam;
642
646
Bitmapset *allParam;
643
647
+
644
- + /* Additional field for an extension purposes. */
645
- + List *private;
648
+ + /*
649
+ + * Additional fields for purposes of an extension.
650
+ + * TODO: allow to serialize/deserialize this list.
651
+ + */
652
+ + List *ext_nodes;
646
653
} Plan;
647
654
648
655
/* ----------------
0 commit comments