
Googling/postgresql
[postgreSQL] vacuum 총정리 (feat. dead_tuple, bloat, autovacuum)
1. MVCC => DEAD_TUPLE => BLOAT postgreSQL은 MVCC(다중버전 동시성 제어)의 이점을 위해 'UPDATE'와 'DELETE' 수행 후 이전 데이터를 즉시 제거하지 않는다. 즉시 제거하지 않은 이전 데이터를 'Dead Tuple'이라고 말한다. 그로 인해, Table Bloat(테이블 팽창), Btree Index Bloat(인덱스 팽창)가 발생할 수 있다. 이는 불필요한 I/O의 증가와 부적절한 인덱싱을 초래한다. 1-1. 어떻게 확인하는가? 🔎 팽창(BLOAT) 확인 : Githup 오픈소스[⭐1.1k] (https://github.com/pgexperts/pgx_scripts/tree/master/bloat) 튜플 확인 SELECT relname, n_dead_tup,..