Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Cribbed from https://www.dbrnd.com/2016/10/postgresql-script-to-find-total-live-tuples-and-dead-tuples-row-of-a-table-execute-vacuum-remove-fragmentation-improve-performance/
- SELECT
- schemaname || '.' || relname AS TableName
- ,n_live_tup AS LiveTuples
- ,n_dead_tup AS DeadTuples
- FROM pg_stat_user_tables
- WHERE n_live_tup > 0
- ORDER by n_dead_tup DESC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement