3434 * for the life of the backend. Also, we zero out the t_id fields of the
3535 * contained PgStat_TableStatus structs whenever they are not actively in use.
3636 * This allows relcache pgstat_info pointers to be treated as long-lived data,
37- * avoiding repeated searches inpgstat_relation_init () when a relation is
37+ * avoiding repeated searches inpgstat_init_relation () when a relation is
3838 * repeatedly opened during a transaction.
3939 */
4040#define TABSTAT_QUANTUM 100/* we alloc this many at a time */
@@ -78,8 +78,8 @@ static PgStat_TableStatus *get_tabstat_entry(Oid rel_id, bool isshared);
7878static void pgstat_send_tabstat (PgStat_MsgTabstat * tsmsg ,TimestampTz now );
7979static void add_tabstat_xact_level (PgStat_TableStatus * pgstat_info ,int nest_level );
8080static void ensure_tabstat_xact_level (PgStat_TableStatus * pgstat_info );
81- static void pgstat_truncdrop_save_counters (PgStat_TableXactStatus * trans ,bool is_drop );
82- static void pgstat_truncdrop_restore_counters (PgStat_TableXactStatus * trans );
81+ static void save_truncdrop_counters (PgStat_TableXactStatus * trans ,bool is_drop );
82+ static void restore_truncdrop_counters (PgStat_TableXactStatus * trans );
8383
8484
8585/*
@@ -109,7 +109,7 @@ pgstat_copy_relation_stats(Relation dst, Relation src)
109109if (!srcstats )
110110return ;
111111
112- if (pgstat_relation_should_count (dst ))
112+ if (pgstat_should_count_relation (dst ))
113113{
114114/*
115115 * XXX: temporarily this does not actually quite do what the name
@@ -137,7 +137,7 @@ pgstat_copy_relation_stats(Relation dst, Relation src)
137137 * same relation is touched repeatedly within a transaction.
138138 */
139139void
140- pgstat_relation_init (Relation rel )
140+ pgstat_init_relation (Relation rel )
141141{
142142Oid rel_id = rel -> rd_id ;
143143char relkind = rel -> rd_rel -> relkind ;
@@ -242,7 +242,7 @@ pgstat_report_analyze(Relation rel,
242242 *
243243 * Waste no time on partitioned tables, though.
244244 */
245- if (pgstat_relation_should_count (rel )&&
245+ if (pgstat_should_count_relation (rel )&&
246246rel -> rd_rel -> relkind != RELKIND_PARTITIONED_TABLE )
247247{
248248PgStat_TableXactStatus * trans ;
@@ -276,7 +276,7 @@ pgstat_report_analyze(Relation rel,
276276void
277277pgstat_count_heap_insert (Relation rel ,PgStat_Counter n )
278278{
279- if (pgstat_relation_should_count (rel ))
279+ if (pgstat_should_count_relation (rel ))
280280{
281281PgStat_TableStatus * pgstat_info = rel -> pgstat_info ;
282282
@@ -291,7 +291,7 @@ pgstat_count_heap_insert(Relation rel, PgStat_Counter n)
291291void
292292pgstat_count_heap_update (Relation rel ,bool hot )
293293{
294- if (pgstat_relation_should_count (rel ))
294+ if (pgstat_should_count_relation (rel ))
295295{
296296PgStat_TableStatus * pgstat_info = rel -> pgstat_info ;
297297
@@ -310,7 +310,7 @@ pgstat_count_heap_update(Relation rel, bool hot)
310310void
311311pgstat_count_heap_delete (Relation rel )
312312{
313- if (pgstat_relation_should_count (rel ))
313+ if (pgstat_should_count_relation (rel ))
314314{
315315PgStat_TableStatus * pgstat_info = rel -> pgstat_info ;
316316
@@ -325,12 +325,12 @@ pgstat_count_heap_delete(Relation rel)
325325void
326326pgstat_count_truncate (Relation rel )
327327{
328- if (pgstat_relation_should_count (rel ))
328+ if (pgstat_should_count_relation (rel ))
329329{
330330PgStat_TableStatus * pgstat_info = rel -> pgstat_info ;
331331
332332ensure_tabstat_xact_level (pgstat_info );
333- pgstat_truncdrop_save_counters (pgstat_info -> trans , false);
333+ save_truncdrop_counters (pgstat_info -> trans , false);
334334pgstat_info -> trans -> tuples_inserted = 0 ;
335335pgstat_info -> trans -> tuples_updated = 0 ;
336336pgstat_info -> trans -> tuples_deleted = 0 ;
@@ -348,7 +348,7 @@ pgstat_count_truncate(Relation rel)
348348void
349349pgstat_update_heap_dead_tuples (Relation rel ,int delta )
350350{
351- if (pgstat_relation_should_count (rel ))
351+ if (pgstat_should_count_relation (rel ))
352352{
353353PgStat_TableStatus * pgstat_info = rel -> pgstat_info ;
354354
@@ -405,7 +405,7 @@ AtEOXact_PgStat_Relations(PgStat_SubXactStatus *xact_state, bool isCommit)
405405Assert (tabstat -> trans == trans );
406406/* restore pre-truncate/drop stats (if any) in case of aborted xact */
407407if (!isCommit )
408- pgstat_truncdrop_restore_counters (trans );
408+ restore_truncdrop_counters (trans );
409409/* count attempted actions regardless of commit/abort */
410410tabstat -> t_counts .t_tuples_inserted += trans -> tuples_inserted ;
411411tabstat -> t_counts .t_tuples_updated += trans -> tuples_updated ;
@@ -470,7 +470,7 @@ AtEOSubXact_PgStat_Relations(PgStat_SubXactStatus *xact_state, bool isCommit, in
470470if (trans -> truncdropped )
471471{
472472/* propagate the truncate/drop status one level up */
473- pgstat_truncdrop_save_counters (trans -> upper , false);
473+ save_truncdrop_counters (trans -> upper , false);
474474/* replace upper xact stats with ours */
475475trans -> upper -> tuples_inserted = trans -> tuples_inserted ;
476476trans -> upper -> tuples_updated = trans -> tuples_updated ;
@@ -497,7 +497,7 @@ AtEOSubXact_PgStat_Relations(PgStat_SubXactStatus *xact_state, bool isCommit, in
497497 */
498498PgStat_SubXactStatus * upper_xact_state ;
499499
500- upper_xact_state = pgstat_xact_stack_level_get (nestDepth - 1 );
500+ upper_xact_state = pgstat_get_xact_stack_level (nestDepth - 1 );
501501trans -> next = upper_xact_state -> first ;
502502upper_xact_state -> first = trans ;
503503trans -> nest_level = nestDepth - 1 ;
@@ -511,7 +511,7 @@ AtEOSubXact_PgStat_Relations(PgStat_SubXactStatus *xact_state, bool isCommit, in
511511 */
512512
513513/* first restore values obliterated by truncate/drop */
514- pgstat_truncdrop_restore_counters (trans );
514+ restore_truncdrop_counters (trans );
515515/* count attempted actions regardless of commit/abort */
516516tabstat -> t_counts .t_tuples_inserted += trans -> tuples_inserted ;
517517tabstat -> t_counts .t_tuples_updated += trans -> tuples_updated ;
@@ -860,7 +860,7 @@ add_tabstat_xact_level(PgStat_TableStatus *pgstat_info, int nest_level)
860860 * If this is the first rel to be modified at the current nest level, we
861861 * first have to push a transaction stack entry.
862862 */
863- xact_state = pgstat_xact_stack_level_get (nest_level );
863+ xact_state = pgstat_get_xact_stack_level (nest_level );
864864
865865/* Now make a per-table stack entry */
866866trans = (PgStat_TableXactStatus * )
@@ -897,7 +897,7 @@ ensure_tabstat_xact_level(PgStat_TableStatus *pgstat_info)
897897 * subxact level only.
898898 */
899899static void
900- pgstat_truncdrop_save_counters (PgStat_TableXactStatus * trans ,bool is_drop )
900+ save_truncdrop_counters (PgStat_TableXactStatus * trans ,bool is_drop )
901901{
902902if (!trans -> truncdropped || is_drop )
903903{
@@ -912,7 +912,7 @@ pgstat_truncdrop_save_counters(PgStat_TableXactStatus *trans, bool is_drop)
912912 * restore counters when a truncate aborts
913913 */
914914static void
915- pgstat_truncdrop_restore_counters (PgStat_TableXactStatus * trans )
915+ restore_truncdrop_counters (PgStat_TableXactStatus * trans )
916916{
917917if (trans -> truncdropped )
918918{