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 us.relname, us.n_live_tup, us.n_dead_tup | |
| FROM pg_stat_user_tables us | |
| WHERE us.schemaname = 'dados_ocorridos' | |
| order by n_dead_tup desc |
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
| -- CHECK CACHE RATE -- | |
| SELECT | |
| sum(heap_blks_read) as heap_read, | |
| sum(heap_blks_hit) as heap_hit, | |
| sum(heap_blks_hit) / (sum(heap_blks_hit) + sum(heap_blks_read)) as ratio | |
| FROM | |
| pg_statio_user_tables; | |
| -- CHECK INDEX USAGE --- |
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 pg_cancel_backend(pid of the postgres process); | |
| --------------------------------------------------------------------- | |
| SELECT pg_terminate_backend(pid) | |
| from pg_stat_activity | |
| where query ilike '%autovacuum%' | |
| and pid <> pg_backend_pid() |
NewerOlder