What is the meaning of n_live_tup and n_dead_tup in pg_stat_user_tables or pgstattuple?
|
|
|
Those two columns are the result of
Representing the number of live and dead rows (tuples) in the table. Dead rows are deleted rows that will later be cleaned up by vacuuming the table or the disk space may be reused by HOT (Heap-Only Tuples) updates. (More on H.O.T. in the release notes for PostgreSQL 8.3 where this feature was introduced.) When ever you delete or update a row, the old row version becomes invisible - a dead row. That is necessary for PostgreSQL's MVCC model that handles concurrency. Those are just statistics. You need to enable statistics collection in |
|||||||||||
|