pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Track per-relation cumulative time spent in [auto]vacuum and [au
Date: Tue, 28 Jan 2025 00:59:30 +0000
Message-ID: <E1tcZww-003vl0-1d@gemulon.postgresql.org> (raw)

Track per-relation cumulative time spent in [auto]vacuum and [auto]analyze

This commit adds four fields to the statistics of relations, aggregating
the amount of time spent for each operation on a relation:
- total_vacuum_time, for manual vacuum.
- total_autovacuum_time, for vacuum done by the autovacuum daemon.
- total_analyze_time, for manual analyze.
- total_autoanalyze_time, for analyze done by the autovacuum daemon.

This gives users the option to derive the average time spent for these
operations with the help of the related "count" fields.

Bump catalog version (for the catalog changes) and PGSTAT_FILE_FORMAT_ID
(for the additions in PgStat_StatTabEntry).

Author: Sami Imseih
Reviewed-by: Bertrand Drouvot, Michael Paquier
Discussion: https://postgr.es/m/CAA5RZ0uVOGBYmPEeGF2d1B_67tgNjKx_bKDuL+oUftuoz+=Y1g@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/30a6ed0ce4bb18212ec38cdb537ea4b43bc99b83

Modified Files
--------------
doc/src/sgml/monitoring.sgml                 | 38 ++++++++++++++++++++++++++++
src/backend/access/heap/vacuumlazy.c         |  7 +++--
src/backend/catalog/system_views.sql         |  6 ++++-
src/backend/commands/analyze.c               | 12 +++++----
src/backend/utils/activity/pgstat_relation.c | 21 ++++++++++++---
src/backend/utils/adt/pgstatfuncs.c          | 28 ++++++++++++++++++++
src/include/catalog/catversion.h             |  2 +-
src/include/catalog/pg_proc.dat              | 16 ++++++++++++
src/include/pgstat.h                         | 12 ++++++---
src/test/regress/expected/rules.out          | 18 ++++++++++---
10 files changed, 141 insertions(+), 19 deletions(-)



Message-ID: <E1tcZww-003vl0-1d@gemulon.postgresql.org>
Permalink:  ../E1tcZww-003vl0-1d@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tcZww-003vl0-1d@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Track per-relation cumulative time spent in [auto]vacuum and [au
  In-Reply-To: <E1tcZww-003vl0-1d@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox