Ou comment maintenir ses instances en conditions opérationnelles
Dalibo & Contributeurs
pitrery
sqlserver2pgsql
| sy.pɛʁ.vi.ze |
« Se placer au-dessus pour voir, remarquer, prendre des mesures »
lc_messages='C'
log_line_prefix = '%t [%p]: user=%u,db=%d,app=%a,client=%h '
log_connections
log_disconnections
log_autovacuum_min_duration
log_checkpoints
log_lock_waits
log_temp_files
log_min_duration_statement
$ pgbadger postgresql-13-main.log
--outfile
--begin
--end
--dbname
--dbuser
--appname
pg_stat_statements
MVCC
ctid
xmin
xmax
Table initiale :
BEGIN; UPDATE soldes SET solde=solde-200 WHERE nom = 'M. Durand';
UPDATE soldes SET solde=solde+200 WHERE nom = 'Mme Martin';
VACUUM
nb_enregistrements_morts (n_dead_tup) >= autovacuum_vacuum_threshold + nb_enregs × autovacuum_vacuum_scale_factor
autovacuum_vacuum_threshold
autovacuum_vacuum_scale_factor
ALTER TABLE table_name SET (autovacuum_vacuum_scale_factor = 0.05);
REINDEX
VACUUM FULL
CONCURRENTLY
REINDEX INDEX index CONCURRENTLY
CREATE INDEX CONCURRENTLY index_bis (...); BEGIN; DROP INDEX index CONCURRENTLY; ALTER INDEX index_bis RENAME TO index; COMMIT;
pg_wal
EXPLAIN
EXPLAIN ANALYSE