@@ -95,17 +95,14 @@ bool have_relation_stats;
95
95
static HTAB * pgStatTabHash = NULL ;
96
96
97
97
98
- /* ----------
99
- * pgstat_relation_init() -
100
- *
101
- * Initialize a relcache entry to count access statistics.
102
- * Called whenever a relation is opened.
98
+ /*
99
+ * Initialize a relcache entry to count access statistics.
100
+ * Called whenever a relation is opened.
103
101
*
104
- * We assume that a relcache entry's pgstat_info field is zeroed by
105
- * relcache.c when the relcache entry is made; thereafter it is long-lived
106
- * data. We can avoid repeated searches of the TabStatus arrays when the
107
- * same relation is touched repeatedly within a transaction.
108
- * ----------
102
+ * We assume that a relcache entry's pgstat_info field is zeroed by
103
+ * relcache.c when the relcache entry is made; thereafter it is long-lived
104
+ * data. We can avoid repeated searches of the TabStatus arrays when the
105
+ * same relation is touched repeatedly within a transaction.
109
106
*/
110
107
void
111
108
pgstat_relation_init (Relation rel )
@@ -141,16 +138,13 @@ pgstat_relation_init(Relation rel)
141
138
rel -> pgstat_info = get_tabstat_entry (rel_id , rel -> rd_rel -> relisshared );
142
139
}
143
140
144
- /* ----------
145
- * pgstat_drop_relation() -
146
- *
147
- * Tell the collector that we just dropped a relation.
148
- * (If the message gets lost, we will still clean the dead entry eventually
149
- * via future invocations of pgstat_vacuum_stat().)
141
+ /*
142
+ * Tell the collector that we just dropped a relation.
143
+ * (If the message gets lost, we will still clean the dead entry eventually
144
+ * via future invocations of pgstat_vacuum_stat().)
150
145
*
151
- * Currently not used for lack of any good place to call it; we rely
152
- * entirely on pgstat_vacuum_stat() to clean out stats for dead rels.
153
- * ----------
146
+ * Currently not used for lack of any good place to call it; we rely
147
+ * entirely on pgstat_vacuum_stat() to clean out stats for dead rels.
154
148
*/
155
149
#ifdef NOT_USED
156
150
void
@@ -173,13 +167,10 @@ pgstat_drop_relation(Oid relid)
173
167
}
174
168
#endif /* NOT_USED */
175
169
176
- /* ----------
177
- * pgstat_report_autovac() -
178
- *
179
- * Called from autovacuum.c to report startup of an autovacuum process.
180
- * We are called before InitPostgres is done, so can't rely on MyDatabaseId;
181
- * the db OID must be passed in, instead.
182
- * ----------
170
+ /*
171
+ * Called from autovacuum.c to report startup of an autovacuum process.
172
+ * We are called before InitPostgres is done, so can't rely on MyDatabaseId;
173
+ * the db OID must be passed in, instead.
183
174
*/
184
175
void
185
176
pgstat_report_autovac (Oid dboid )
@@ -196,11 +187,8 @@ pgstat_report_autovac(Oid dboid)
196
187
pgstat_send (& msg , sizeof (msg ));
197
188
}
198
189
199
- /* ---------
200
- * pgstat_report_vacuum() -
201
- *
202
- * Tell the collector about the table we just vacuumed.
203
- * ---------
190
+ /*
191
+ * Tell the collector about the table we just vacuumed.
204
192
*/
205
193
void
206
194
pgstat_report_vacuum (Oid tableoid , bool shared ,
@@ -221,14 +209,11 @@ pgstat_report_vacuum(Oid tableoid, bool shared,
221
209
pgstat_send (& msg , sizeof (msg ));
222
210
}
223
211
224
- /* --------
225
- * pgstat_report_analyze() -
226
- *
227
- * Tell the collector about the table we just analyzed.
212
+ /*
213
+ * Tell the collector about the table we just analyzed.
228
214
*
229
215
* Caller must provide new live- and dead-tuples estimates, as well as a
230
216
* flag indicating whether to reset the changes_since_analyze counter.
231
- * --------
232
217
*/
233
218
void
234
219
pgstat_report_analyze (Relation rel ,
@@ -281,7 +266,7 @@ pgstat_report_analyze(Relation rel,
281
266
}
282
267
283
268
/*
284
- * pgstat_count_heap_insert - count a tuple insertion of n tuples
269
+ * count a tuple insertion of n tuples
285
270
*/
286
271
void
287
272
pgstat_count_heap_insert (Relation rel , PgStat_Counter n )
@@ -296,7 +281,7 @@ pgstat_count_heap_insert(Relation rel, PgStat_Counter n)
296
281
}
297
282
298
283
/*
299
- * pgstat_count_heap_update - count a tuple update
284
+ * count a tuple update
300
285
*/
301
286
void
302
287
pgstat_count_heap_update (Relation rel , bool hot )
@@ -315,7 +300,7 @@ pgstat_count_heap_update(Relation rel, bool hot)
315
300
}
316
301
317
302
/*
318
- * pgstat_count_heap_delete - count a tuple deletion
303
+ * count a tuple deletion
319
304
*/
320
305
void
321
306
pgstat_count_heap_delete (Relation rel )
@@ -330,7 +315,7 @@ pgstat_count_heap_delete(Relation rel)
330
315
}
331
316
332
317
/*
333
- * pgstat_count_truncate - update tuple counters due to truncate
318
+ * update tuple counters due to truncate
334
319
*/
335
320
void
336
321
pgstat_count_truncate (Relation rel )
@@ -348,7 +333,7 @@ pgstat_count_truncate(Relation rel)
348
333
}
349
334
350
335
/*
351
- * pgstat_update_heap_dead_tuples - update dead-tuples count
336
+ * update dead-tuples count
352
337
*
353
338
* The semantics of this are that we are reporting the nontransactional
354
339
* recovery of "delta" dead tuples; so t_delta_dead_tuples decreases
@@ -367,7 +352,7 @@ pgstat_update_heap_dead_tuples(Relation rel, int delta)
367
352
}
368
353
369
354
/*
370
- * find_tabstat_entry - find any existing PgStat_TableStatus entry for rel
355
+ * find any existing PgStat_TableStatus entry for rel
371
356
*
372
357
* If no entry, return NULL, don't create a new one
373
358
*
@@ -772,7 +757,7 @@ pgstat_send_tabstat(PgStat_MsgTabstat *tsmsg, TimestampTz now)
772
757
}
773
758
774
759
/*
775
- * get_tabstat_entry - find or create a PgStat_TableStatus entry for rel
760
+ * find or create a PgStat_TableStatus entry for rel
776
761
*/
777
762
static PgStat_TableStatus *
778
763
get_tabstat_entry (Oid rel_id , bool isshared )
@@ -858,7 +843,7 @@ get_tabstat_entry(Oid rel_id, bool isshared)
858
843
}
859
844
860
845
/*
861
- * add_tabstat_xact_level - add a new (sub)transaction state record
846
+ * add a new (sub)transaction state record
862
847
*/
863
848
static void
864
849
add_tabstat_xact_level (PgStat_TableStatus * pgstat_info , int nest_level )
@@ -898,8 +883,6 @@ ensure_tabstat_xact_level(PgStat_TableStatus *pgstat_info)
898
883
}
899
884
900
885
/*
901
- * pgstat_truncdrop_save_counters
902
- *
903
886
* Whenever a table is truncated/dropped, we save its i/u/d counters so that
904
887
* they can be cleared, and if the (sub)xact that executed the truncate/drop
905
888
* later aborts, the counters can be restored to the saved (pre-truncate/drop)
@@ -921,7 +904,7 @@ pgstat_truncdrop_save_counters(PgStat_TableXactStatus *trans, bool is_drop)
921
904
}
922
905
923
906
/*
924
- * pgstat_truncdrop_restore_counters - restore counters when a truncate aborts
907
+ * restore counters when a truncate aborts
925
908
*/
926
909
static void
927
910
pgstat_truncdrop_restore_counters (PgStat_TableXactStatus * trans )
0 commit comments