4 ms·
After working with PostgreSQL for many years, my best advice (for repeated queries, e.g. often hit Web app queries) is to make sure they all use indexes and all
by epi0Bauqu 18y ago
After working with PostgreSQL for many years, my best advice (for repeated queries, e.g. often hit Web app queries) is to make sure they all use indexes and all the indexes fit in memory.
You can get sizes from: SELECT relname,relfilenode,relpages*8/1024 AS MB FROM pg_class ORDER BY MB DESC LIMIT 10;
Newer versions avoid bloat better, but it can still happen if you don't vacuum full, which you don't because of downtime implications. So every now and then it is good to recopy everything in.