autoanalyze不及时问题

This commit is contained in:
jiangyan
2024-02-29 14:45:53 +08:00
parent d8857d3816
commit f39494103d

View File

@ -7190,10 +7190,12 @@ static void pgstat_recv_vacuum(PgStat_MsgVacuum* msg, int len)
tabentry = pgstat_get_tab_entry(dbentry, msg->m_tableoid, true, msg->m_statFlag);
/* Resetting dead_tuples ... use negtive number to verify Cstore */
if (msg->m_tuples < 0)
if (msg->m_tuples < 0) {
tabentry->n_dead_tuples = 0;
else
} else {
tabentry->n_dead_tuples = Max(0, tabentry->n_dead_tuples - msg->m_tuples);
tabentry->changes_since_analyze += msg->m_tuples;
}
if (msg->m_autovacuum) {
tabentry->autovac_vacuum_timestamp = msg->m_vacuumtime;