@@ -89,7 +89,7 @@ typedef enum UpperRelationKind
89
89
* planned.
90
90
*
91
91
* Not all fields are printed. (In some cases, there is no print support for
92
- * the field type.)
92
+ * the field type; in others, doing so would lead to infinite recursion .)
93
93
*----------
94
94
*/
95
95
typedef struct PlannerGlobal
@@ -177,7 +177,8 @@ typedef struct PlannerGlobal
177
177
* either here or in that header, whichever is read first.
178
178
*
179
179
* Not all fields are printed. (In some cases, there is no print support for
180
- * the field type.)
180
+ * the field type; in others, doing so would lead to infinite recursion or
181
+ * bloat dump output more than seems useful.)
181
182
*----------
182
183
*/
183
184
#ifndef HAVE_PLANNERINFO_TYPEDEF
@@ -220,22 +221,24 @@ struct PlannerInfo
220
221
* does not correspond to a base relation, such as a join RTE or an
221
222
* unreferenced view RTE; or if the RelOptInfo hasn't been made yet.
222
223
*/
223
- struct RelOptInfo * * simple_rel_array pg_node_attr (read_write_ignore );
224
+ struct RelOptInfo * * simple_rel_array pg_node_attr (array_size ( simple_rel_array_size ) );
224
225
/* allocated size of array */
225
- int simple_rel_array_size pg_node_attr ( read_write_ignore ) ;
226
+ int simple_rel_array_size ;
226
227
227
228
/*
228
229
* simple_rte_array is the same length as simple_rel_array and holds
229
230
* pointers to the associated rangetable entries. Using this is a shade
230
- * faster than using rt_fetch(), mostly due to fewer indirections.
231
+ * faster than using rt_fetch(), mostly due to fewer indirections. (Not
232
+ * printed because it'd be redundant with parse->rtable.)
231
233
*/
232
234
RangeTblEntry * * simple_rte_array pg_node_attr (read_write_ignore );
233
235
234
236
/*
235
237
* append_rel_array is the same length as the above arrays, and holds
236
238
* pointers to the corresponding AppendRelInfo entry indexed by
237
239
* child_relid, or NULL if the rel is not an appendrel child. The array
238
- * itself is not allocated if append_rel_list is empty.
240
+ * itself is not allocated if append_rel_list is empty. (Not printed
241
+ * because it'd be redundant with append_rel_list.)
239
242
*/
240
243
struct AppendRelInfo * * append_rel_array pg_node_attr (read_write_ignore );
241
244
@@ -273,6 +276,9 @@ struct PlannerInfo
273
276
* join_cur_level is the current level. New join-relation RelOptInfos are
274
277
* automatically added to the join_rel_level[join_cur_level] list.
275
278
* join_rel_level is NULL if not in use.
279
+ *
280
+ * Note: we've already printed all baserel and joinrel RelOptInfos above,
281
+ * so we don't dump join_rel_level or other lists of RelOptInfos.
276
282
*/
277
283
/* lists of join-relation RelOptInfos */
278
284
List * * join_rel_level pg_node_attr (read_write_ignore );
@@ -403,8 +409,8 @@ struct PlannerInfo
403
409
/*
404
410
* Fields filled during create_plan() for use in setrefs.c
405
411
*/
406
- /* for GroupingFunc fixup */
407
- AttrNumber * grouping_map pg_node_attr (array_size ( update_colnos ), read_write_ignore );
412
+ /* for GroupingFunc fixup (can't print: array length not known here) */
413
+ AttrNumber * grouping_map pg_node_attr (read_write_ignore );
408
414
/* List of MinMaxAggInfos */
409
415
List * minmax_aggs ;
410
416
@@ -458,7 +464,7 @@ struct PlannerInfo
458
464
/* PARAM_EXEC ID for the work table */
459
465
int wt_param_id ;
460
466
/* a path for non-recursive term */
461
- struct Path * non_recursive_path pg_node_attr ( read_write_ignore ) ;
467
+ struct Path * non_recursive_path ;
462
468
463
469
/*
464
470
* These fields are workspace for createplan.c
@@ -470,7 +476,9 @@ struct PlannerInfo
470
476
471
477
/*
472
478
* These fields are workspace for setrefs.c. Each is an array
473
- * corresponding to glob->subplans.
479
+ * corresponding to glob->subplans. (We could probably teach
480
+ * gen_node_support.pl how to determine the array length, but it doesn't
481
+ * seem worth the trouble, so just mark them read_write_ignore.)
474
482
*/
475
483
bool * isAltSubplan pg_node_attr (read_write_ignore );
476
484
bool * isUsedSubplan pg_node_attr (read_write_ignore );
@@ -928,16 +936,17 @@ typedef struct RelOptInfo
928
936
* Number of partitions; -1 if not yet set; in case of a join relation 0
929
937
* means it's considered unpartitioned
930
938
*/
931
- int nparts pg_node_attr ( read_write_ignore ) ;
939
+ int nparts ;
932
940
/* Partition bounds */
933
941
struct PartitionBoundInfoData * boundinfo pg_node_attr (read_write_ignore );
934
942
/* True if partition bounds were created by partition_bounds_merge() */
935
943
bool partbounds_merged ;
936
944
/* Partition constraint, if not the root */
937
- List * partition_qual pg_node_attr ( read_write_ignore ) ;
945
+ List * partition_qual ;
938
946
939
947
/*
940
948
* Array of RelOptInfos of partitions, stored in the same order as bounds
949
+ * (don't print, too bulky and duplicative)
941
950
*/
942
951
struct RelOptInfo * * part_rels pg_node_attr (read_write_ignore );
943
952
@@ -948,6 +957,12 @@ typedef struct RelOptInfo
948
957
Bitmapset * live_parts ;
949
958
/* Relids set of all partition relids */
950
959
Relids all_partrels ;
960
+
961
+ /*
962
+ * These arrays are of length partkey->partnatts, which we don't have at
963
+ * hand, so don't try to print
964
+ */
965
+
951
966
/* Non-nullable partition key expressions */
952
967
List * * partexprs pg_node_attr (read_write_ignore );
953
968
/* Nullable partition key expressions */
@@ -1042,30 +1057,26 @@ struct IndexOptInfo
1042
1057
int nkeycolumns ;
1043
1058
1044
1059
/*
1045
- * array fields aren't really worth the trouble to print
1046
- */
1047
-
1048
- /*
1049
- * column numbers of index's attributes both key and included columns, or
1050
- * 0
1060
+ * table column numbers of index's columns (both key and included
1061
+ * columns), or 0 for expression columns
1051
1062
*/
1052
- int * indexkeys pg_node_attr (read_write_ignore );
1063
+ int * indexkeys pg_node_attr (array_size ( ncolumns ) );
1053
1064
/* OIDs of collations of index columns */
1054
- Oid * indexcollations pg_node_attr (read_write_ignore );
1065
+ Oid * indexcollations pg_node_attr (array_size ( nkeycolumns ) );
1055
1066
/* OIDs of operator families for columns */
1056
- Oid * opfamily pg_node_attr (read_write_ignore );
1067
+ Oid * opfamily pg_node_attr (array_size ( nkeycolumns ) );
1057
1068
/* OIDs of opclass declared input data types */
1058
- Oid * opcintype pg_node_attr (read_write_ignore );
1069
+ Oid * opcintype pg_node_attr (array_size ( nkeycolumns ) );
1059
1070
/* OIDs of btree opfamilies, if orderable */
1060
- Oid * sortopfamily pg_node_attr (read_write_ignore );
1071
+ Oid * sortopfamily pg_node_attr (array_size ( nkeycolumns ) );
1061
1072
/* is sort order descending? */
1062
- bool * reverse_sort pg_node_attr (read_write_ignore );
1073
+ bool * reverse_sort pg_node_attr (array_size ( nkeycolumns ) );
1063
1074
/* do NULLs come first in the sort order? */
1064
- bool * nulls_first pg_node_attr (read_write_ignore );
1075
+ bool * nulls_first pg_node_attr (array_size ( nkeycolumns ) );
1065
1076
/* opclass-specific options for columns */
1066
1077
bytea * * opclassoptions pg_node_attr (read_write_ignore );
1067
1078
/* which index cols can be returned in an index-only scan? */
1068
- bool * canreturn pg_node_attr (read_write_ignore );
1079
+ bool * canreturn pg_node_attr (array_size ( ncolumns ) );
1069
1080
/* OID of the access method (in pg_am) */
1070
1081
Oid relam ;
1071
1082
@@ -1098,19 +1109,19 @@ struct IndexOptInfo
1098
1109
1099
1110
/*
1100
1111
* Remaining fields are copied from the index AM's API struct
1101
- * (IndexAmRoutine). We don't bother to dump them.
1112
+ * (IndexAmRoutine).
1102
1113
*/
1103
- bool amcanorderbyop pg_node_attr ( read_write_ignore ) ;
1104
- bool amoptionalkey pg_node_attr ( read_write_ignore ) ;
1105
- bool amsearcharray pg_node_attr ( read_write_ignore ) ;
1106
- bool amsearchnulls pg_node_attr ( read_write_ignore ) ;
1114
+ bool amcanorderbyop ;
1115
+ bool amoptionalkey ;
1116
+ bool amsearcharray ;
1117
+ bool amsearchnulls ;
1107
1118
/* does AM have amgettuple interface? */
1108
- bool amhasgettuple pg_node_attr ( read_write_ignore ) ;
1119
+ bool amhasgettuple ;
1109
1120
/* does AM have amgetbitmap interface? */
1110
- bool amhasgetbitmap pg_node_attr ( read_write_ignore ) ;
1111
- bool amcanparallel pg_node_attr ( read_write_ignore ) ;
1121
+ bool amhasgetbitmap ;
1122
+ bool amcanparallel ;
1112
1123
/* does AM have ammarkpos interface? */
1113
- bool amcanmarkpos pg_node_attr ( read_write_ignore ) ;
1124
+ bool amcanmarkpos ;
1114
1125
/* AM's cost estimator */
1115
1126
/* Rather than include amapi.h here, we declare amcostestimate like this */
1116
1127
void (* amcostestimate ) () pg_node_attr (read_write_ignore );
@@ -1184,12 +1195,9 @@ typedef struct StatisticExtInfo
1184
1195
Oid statOid ;
1185
1196
1186
1197
/* includes child relations */
1187
- bool inherit pg_node_attr ( read_write_ignore ) ;
1198
+ bool inherit ;
1188
1199
1189
- /*
1190
- * back-link to statistic's table; don't print, infinite recursion on plan
1191
- * tree dump
1192
- */
1200
+ /* back-link to statistic's table; don't print, else infinite recursion */
1193
1201
RelOptInfo * rel pg_node_attr (read_write_ignore );
1194
1202
1195
1203
/* statistics kind of this entry */
0 commit comments