Bloating tabulek.
Ukaz nejvetsi tabulky v Posatgresu:
SELECT relname, pg_size_pretty(pg_table_size(C.oid))
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;
Ukaz mnozstvi bloatu v tabulkach (dead tuples number)
SELECT relname, n_dead_tup FROM pg_stat_user_tables;