Last active
June 8, 2020 15:22
-
-
Save slabad/30b3a0c20a891a77b5164d08a7e9be9c to your computer and use it in GitHub Desktop.
live and dead tuples #postgres #psql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
schemaname | |
,relname AS TableName | |
,n_live_tup AS LiveTuples | |
,n_dead_tup AS DeadTuples | |
FROM pg_stat_user_tables | |
ORDER BY n_live_tup DESC | |
; | |
SELECT | |
relname AS ObjectName | |
,pg_stat_get_live_tuples(c.oid) AS LiveTuples | |
,pg_stat_get_dead_tuples(c.oid) AS DeadTuples | |
FROM pg_class c; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment