{"thread":{"id":"LmQLJCU-lVmo","title":"Postgres table much bigger than the data in it","content":"Table has maybe 2 million rows and takes 60GB. A row is around 200 bytes. Updates a lot. Is this normal? autovacuum is on.","category":"help","status":"open","author":"Anonymous","createdAt":"2026-11-01T08:51:50.234Z","updatedAt":"2026-11-02T21:31:50.234Z","expiresAt":null,"replyCount":2},"replies":[{"id":"OLI4HylquxP9","content":"That's bloat. Check first whether autovacuum is keeping up:\n\nSELECT relname, n_dead_tup, last_autovacuum FROM pg_stat_user_tables ORDER BY n_dead_tup DESC LIMIT 5;\n\nIf last_autovacuum is old, look for a long-running transaction, idle in transaction is the usual culprit, it stops dead rows being cleaned. Then lower autovacuum_vacuum_scale_factor on that table.\n\nNormal VACUUM frees the space for reuse but doesn't give it back to the OS. VACUUM FULL does and locks the table for the duration. pg_repack if you can't have that.","author":"marta_k","createdAt":"2026-11-01T09:56:50.234Z"},{"id":"QGQNYypbKShi","content":"idle in transaction, 9 days, a reporting tool someone left open. thank you","author":"Anonymous","createdAt":"2026-11-02T21:31:50.234Z"}]}