Skip to content

Commit 7193a90

Browse files
committed
Zero out vacuum_count and related counters in pgstat_recv_tabstat().
This fixes an oversight in commit 946045f of 2010-08-21, as reported by Itagaki Takahiro. Also a couple of minor cosmetic adjustments.
1 parent faba108 commit 7193a90

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/backend/postmaster/pgstat.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3245,14 +3245,13 @@ pgstat_get_tab_entry(PgStat_StatDBEntry *dbentry, Oid tableoid, bool create)
32453245
result->changes_since_analyze = 0;
32463246
result->blocks_fetched = 0;
32473247
result->blocks_hit = 0;
3248-
32493248
result->vacuum_timestamp = 0;
3250-
result->autovac_vacuum_timestamp = 0;
3251-
result->analyze_timestamp = 0;
3252-
result->autovac_analyze_timestamp = 0;
32533249
result->vacuum_count = 0;
3250+
result->autovac_vacuum_timestamp = 0;
32543251
result->autovac_vacuum_count = 0;
3252+
result->analyze_timestamp = 0;
32553253
result->analyze_count = 0;
3254+
result->autovac_analyze_timestamp = 0;
32563255
result->autovac_analyze_count = 0;
32573256
}
32583257

@@ -3928,9 +3927,13 @@ pgstat_recv_tabstat(PgStat_MsgTabstat *msg, int len)
39283927
tabentry->blocks_hit = tabmsg->t_counts.t_blocks_hit;
39293928

39303929
tabentry->vacuum_timestamp = 0;
3930+
tabentry->vacuum_count = 0;
39313931
tabentry->autovac_vacuum_timestamp = 0;
3932+
tabentry->autovac_vacuum_count = 0;
39323933
tabentry->analyze_timestamp = 0;
3934+
tabentry->analyze_count = 0;
39333935
tabentry->autovac_analyze_timestamp = 0;
3936+
tabentry->autovac_analyze_count = 0;
39343937
}
39353938
else
39363939
{
@@ -4149,9 +4152,11 @@ pgstat_recv_resetsinglecounter(PgStat_MsgResetsinglecounter *msg, int len)
41494152

41504153
/* Remove object if it exists, ignore it if not */
41514154
if (msg->m_resettype == RESET_TABLE)
4152-
(void) hash_search(dbentry->tables, (void *) &(msg->m_objectid), HASH_REMOVE, NULL);
4155+
(void) hash_search(dbentry->tables, (void *) &(msg->m_objectid),
4156+
HASH_REMOVE, NULL);
41534157
else if (msg->m_resettype == RESET_FUNCTION)
4154-
(void) hash_search(dbentry->functions, (void *) &(msg->m_objectid), HASH_REMOVE, NULL);
4158+
(void) hash_search(dbentry->functions, (void *) &(msg->m_objectid),
4159+
HASH_REMOVE, NULL);
41554160
}
41564161

41574162
/* ----------

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy