3 ms·
In general you don't need to vacuum manually, this happens in the background automatically. If you have a lot of activity on the DB, or fit into certain corner
by fabian2k 6y ago
In general you don't need to vacuum manually, this happens in the background automatically. If you have a lot of activity on the DB, or fit into certain corner cases you have to tune the autovacuum parameters. The default is generally getting better with each Postgres release.
And if you want to play with the Autovacuum settings, you really should read up on this in detail. There are some counter intuitive aspects to it, e.g. in many cases if you have problems with autovacuuming you should vacuum more, not less.
One exception is after you restore a backup, you might want to run "VACUUM ANALYZE" so that you get some good statistics immediately. That also will happen in the background later, but until then you can get weird query plans.
- dtech 6y agoJust ANALYZE also works
- yxhuvud 6y agoRegarding the last point, I wonder if that will be necessary after the changes in the OP. Example 2 might cover this.
- welder 6y agoNormally you only need to adjust autovacuum settings per table if your tables have a very large number of rows: https://lob.com/blog/supercharge-your-postgresql-performance/ https://lob.com/blog/supercharge-your-postgresql-performance...
- GordonS 6y agoIs auto-vacuum enabled by default?