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
-- Temporary file usage by database | |
SELECT datname AS "database", temp_files AS "Temporary files", temp_bytes | |
AS "Size of temporary files" | |
FROM pg_stat_database; | |
-- Cache Hit Ratio. Anything greater than 90% is always good | |
SELECT sum(blks_hit)*100/sum(blks_hit+blks_read) AS hit_ratio FROM pg_stat_database; | |
-- Top Queries | |
SELECT substr(query, 0, 250), calls, |