Closed thbar closed 1 year ago
La section "Vacuum Statistics" de cet article donne la query suivante:
SELECT
n.nspname AS schema_name,
c.relname AS table_name,
c.reltuples AS row_count,
c.relpages AS page_count,
s.n_dead_tup AS dead_row_count,
s.last_vacuum,
s.last_autovacuum,
s.last_analyze,
s.last_autoanalyze
FROM
pg_class c
JOIN pg_namespace n ON n.oid = c.relnamespace
LEFT JOIN pg_stat_user_tables s ON s.relid = c.oid
WHERE
c.relkind = 'r'
AND n.nspname = 'public';
J'ai la sensation que l'auto-vacuum fait bien son travail, à regarder les "dead rows" et le timestamp de dernier auto-vacuum:
@etalab/transport-tech en résumé:
Je clôture.
J'ai l'impression qu'on rentre dans le cas mentionné par la documentation de référence:
PostgreSQL databases require periodic maintenance known as vacuuming. For many installations, it is sufficient to let vacuuming be performed by the autovacuum daemon, which is described in Section 25.1.6.
For those not using autovacuum, a typical approach is to schedule a database-wide VACUUM once a day during a low-usage period, supplemented by more frequent vacuuming of heavily-updated tables as necessary.
Plain VACUUM may not be satisfactory when a table contains large numbers of dead row versions as a result of massive update or delete activity.
Mais à suivre :smile:
Je commence à prendre quelques notes là dessus.
Référence:
Actuellement on a les réglages généraux suivants (https://dba.stackexchange.com/questions/35814):
Et il semble que ces réglages ne soient pas overridés par table :
Il faut qu'on voit si l'auto-vacuum a priori en place est suffisant.