@@ -157,67 +157,74 @@ typedef struct ExprState
157
157
* entries for a particular index. Used for both index_build and
158
158
* retail creation of index entries.
159
159
*
160
- * NumIndexAttrs total number of columns in this index
161
- * NumIndexKeyAttrs number of key columns in index
162
- * IndexAttrNumbers underlying-rel attribute numbers used as keys
163
- * (zeroes indicate expressions). It also contains
164
- * info about included columns.
165
- * Expressions expr trees for expression entries, or NIL if none
166
- * ExpressionsState exec state for expressions, or NIL if none
167
- * Predicate partial-index predicate, or NIL if none
168
- * PredicateState exec state for predicate, or NIL if none
169
- * ExclusionOps Per-column exclusion operators, or NULL if none
170
- * ExclusionProcs Underlying function OIDs for ExclusionOps
171
- * ExclusionStrats Opclass strategy numbers for ExclusionOps
172
- * UniqueOps These are like Exclusion*, but for unique indexes
173
- * UniqueProcs
174
- * UniqueStrats
175
- * Unique is it a unique index?
176
- * NullsNotDistinct is NULLS NOT DISTINCT?
177
- * ReadyForInserts is it valid for inserts?
178
- * CheckedUnchanged IndexUnchanged status determined yet?
179
- * IndexUnchanged aminsert hint, cached for retail inserts
180
- * Concurrent are we doing a concurrent index build?
181
- * BrokenHotChain did we detect any broken HOT chains?
182
- * WithoutOverlaps is it a WITHOUT OVERLAPS index?
183
- * Summarizing is it a summarizing index?
184
- * ParallelWorkers # of workers requested (excludes leader)
185
- * Am Oid of index AM
186
- * AmCache private cache area for index AM
187
- * Context memory context holding this IndexInfo
188
- *
189
160
* ii_Concurrent, ii_BrokenHotChain, and ii_ParallelWorkers are used only
190
161
* during index build; they're conventionally zeroed otherwise.
191
162
* ----------------
192
163
*/
193
164
typedef struct IndexInfo
194
165
{
195
166
NodeTag type ;
196
- int ii_NumIndexAttrs ; /* total number of columns in index */
197
- int ii_NumIndexKeyAttrs ; /* number of key columns in index */
167
+
168
+ /* total number of columns in index */
169
+ int ii_NumIndexAttrs ;
170
+ /* number of key columns in index */
171
+ int ii_NumIndexKeyAttrs ;
172
+
173
+ /*
174
+ * Underlying-rel attribute numbers used as keys (zeroes indicate
175
+ * expressions). It also contains info about included columns.
176
+ */
198
177
AttrNumber ii_IndexAttrNumbers [INDEX_MAX_KEYS ];
178
+
179
+ /* expr trees for expression entries, or NIL if none */
199
180
List * ii_Expressions ; /* list of Expr */
181
+ /* exec state for expressions, or NIL if none */
200
182
List * ii_ExpressionsState ; /* list of ExprState */
183
+
184
+ /* partial-index predicate, or NIL if none */
201
185
List * ii_Predicate ; /* list of Expr */
186
+ /* exec state for expressions, or NIL if none */
202
187
ExprState * ii_PredicateState ;
188
+
189
+ /* Per-column exclusion operators, or NULL if none */
203
190
Oid * ii_ExclusionOps ; /* array with one entry per column */
191
+ /* Underlying function OIDs for ExclusionOps */
204
192
Oid * ii_ExclusionProcs ; /* array with one entry per column */
193
+ /* Opclass strategy numbers for ExclusionOps */
205
194
uint16 * ii_ExclusionStrats ; /* array with one entry per column */
195
+
196
+ /* These are like Exclusion*, but for unique indexes */
206
197
Oid * ii_UniqueOps ; /* array with one entry per column */
207
198
Oid * ii_UniqueProcs ; /* array with one entry per column */
208
199
uint16 * ii_UniqueStrats ; /* array with one entry per column */
200
+
201
+ /* is it a unique index? */
209
202
bool ii_Unique ;
203
+ /* is NULLS NOT DISTINCT? */
210
204
bool ii_NullsNotDistinct ;
205
+ /* is it valid for inserts? */
211
206
bool ii_ReadyForInserts ;
207
+ /* IndexUnchanged status determined yet? */
212
208
bool ii_CheckedUnchanged ;
209
+ /* aminsert hint, cached for retail inserts */
213
210
bool ii_IndexUnchanged ;
211
+ /* are we doing a concurrent index build? */
214
212
bool ii_Concurrent ;
213
+ /* did we detect any broken HOT chains? */
215
214
bool ii_BrokenHotChain ;
215
+ /* is it a summarizing index? */
216
216
bool ii_Summarizing ;
217
+ /* is it a WITHOUT OVERLAPS index? */
217
218
bool ii_WithoutOverlaps ;
219
+ /* # of workers requested (excludes leader) */
218
220
int ii_ParallelWorkers ;
221
+
222
+ /* Oid of index AM */
219
223
Oid ii_Am ;
224
+ /* private cache area for index AM */
220
225
void * ii_AmCache ;
226
+
227
+ /* memory context holding this IndexInfo */
221
228
MemoryContext ii_Context ;
222
229
} IndexInfo ;
223
230
0 commit comments