6 ms·
IMO, needing to clear out an entire table is an indicator that something has gone wrong with your design. Don't get me wrong, I've definitely done it before, b
by cowthulhu 3mo ago
IMO, needing to clear out an entire table is an indicator that something has gone wrong with your design.
Don't get me wrong, I've definitely done it before, but it's in the same bucket as VACUUM for me... high impact interventions used to fix a mistake I made, not "course of business" actions.
- baq 3mo agoYou should run vacuum as often as possible in Postgres if you’re doing anything other than INSERTs, this is a design tradeoff in Postgres itself. It’s the reason autovacuum exists and why tuning it is so important for performance; nothing wrong with doing a VACUUM ANALYZE after finishing a large DML batch job.
- TurdF3rguson 3mo agowhat does as often as possible mean? It will auto-vacuum when it's idle, right? Why not just let it do that?
- baq 3mo agoWhat do you mean by ‘idle’? If you mean your database is seeing extended periods of no updates to a table, you still want to vacuum, maybe even vacuum full if you know when traffic stopped and for how long to get the best possible read performance. If you have quiet periods in both reads and writes, enjoy the luxury of having an unused database to operate.