Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Which tables in your database are most heavily used? Top 10 tables in terms of numbers of rows read:
- SELECT relname, COALESCE(idx_tup_fetch,0) + COALESCE(seq_tup_read,0) AS Total
- FROM pg_stat_all_tables
- WHERE COALESCE(idx_tup_fetch,0) + COALESCE(seq_tup_read,0) <> 0
- AND relname NOT LIKE 'pg_%'
- ORDER BY Total desc
- -- LIMIT 10
- ;
- Variations to above:
- pg_stat_system_tables = system tables
- pg_stat_user_tables = user created tables
- pg_stat_all_indexes = indexes
- pg_stat_system_indexes = system indexes
- pg_stat_user_indexes = user created indexes
- pg_stat
Advertisement
Add Comment
Please, Sign In to add comment