POSTGRES USEFUL INFO

//this is handy:
http://okigiveup.net/what-postgresql-tells-you-about-its-performance/

How to find log files and configure them
https://www.endpoint.com/blog/2014/11/12/dear-postgresql-where-are-my-logs



2020-05-21 THIS SUPERSEDES BELOW  
HOW TO FIND SHITTY INDEXES: https://gist.github.com/jberkus/6b1bcaf7724dfc2a54f3

top five tables by size (bytes)
SELECT 
       relname AS "table_name", 
       pg_table_size(C.oid) AS "table_size" 
FROM 
       pg_class C 
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) 
WHERE nspname NOT IN ('pg_catalog', 'information_schema') AND nspname !~ '^pg_toast' AND relkind IN ('r') 
ORDER BY pg_table_size(C.oid) 
DESC LIMIT 10;


TOTAL DATABASE SIZE
select pg_database_size(current_database());//size in bytes