mirror of
https://github.com/postgres/postgres.git
synced 2025-12-04 12:02:48 +03:00
Generate pg_stat_get*() functions for tables using macros
The same code pattern is repeated 17 times for int64 counters (0 for missing entry) and 5 times for timestamps (NULL for missing entry) on table entries. This code is switched to use a macro for the basic code instead, shaving a few hundred lines of originally-duplicated code. The function names remain the same, but some fields of PgStat_StatTabEntry have to be renamed to cope with the new style. Author: Bertrand Drouvot Reviewed-by: Nathan Bossart Discussion: https:/postgr.es/m/20221204173207.GA2669116@nathanxps13
This commit is contained in:
@@ -3081,9 +3081,9 @@ relation_needs_vacanalyze(Oid relid,
|
||||
if (PointerIsValid(tabentry) && AutoVacuumingActive())
|
||||
{
|
||||
reltuples = classForm->reltuples;
|
||||
vactuples = tabentry->n_dead_tuples;
|
||||
instuples = tabentry->inserts_since_vacuum;
|
||||
anltuples = tabentry->changes_since_analyze;
|
||||
vactuples = tabentry->dead_tuples;
|
||||
instuples = tabentry->ins_since_vacuum;
|
||||
anltuples = tabentry->mod_since_analyze;
|
||||
|
||||
/* If the table hasn't yet been vacuumed, take reltuples as zero */
|
||||
if (reltuples < 0)
|
||||
|
||||
Reference in New Issue
Block a user