diff options
| author | Michael Paquier | 2025-12-17 02:26:17 +0000 |
|---|---|---|
| committer | Michael Paquier | 2025-12-17 02:26:17 +0000 |
| commit | f4e797171eac645eeae2a5e95bf3361bb7f7f0cc (patch) | |
| tree | 99ae443818303a6db1af1d4a35fe988d6e693268 /src/backend/access/heap | |
| parent | 1d325ad99cb2dec0e8b45ba36909ee0a497d2a57 (diff) | |
This change makes pgstat_report_vacuum() more consistent with
pgstat_report_analyze(), that also uses a Relation. This enforces a
policy that callers of this routine should open and lock the relation
whose statistics are updated before calling this routine. We will
unlikely have a lot of callers of this routine in the tree, but it seems
like a good idea to imply this requirement in the long run.
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Suggested-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/aUEA6UZZkDCQFgSA@ip-10-97-1-34.eu-west-3.compute.internal
Diffstat (limited to 'src/backend/access/heap')
| -rw-r--r-- | src/backend/access/heap/vacuumlazy.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index 62035b7f9c3..30778a15639 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -961,8 +961,7 @@ heap_vacuum_rel(Relation rel, const VacuumParams params, * soon in cases where the failsafe prevented significant amounts of heap * vacuuming. */ - pgstat_report_vacuum(RelationGetRelid(rel), - rel->rd_rel->relisshared, + pgstat_report_vacuum(rel, Max(vacrel->new_live_tuples, 0), vacrel->recently_dead_tuples + vacrel->missed_dead_tuples, |
