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.
https://lob.com/blog/supercharge-your-postgresql-performance...
In general, if you don't have extremely high UPDATE rates (thousands per second) you don't really need to care about vacuum these days (assuming you correctly end all your transactions and don't have any sessions in "idle in transaction" for a long time)
https://www.postgresql.org/docs/12/runtime-config-autovacuum...
It might not be technically pure, but you absolutely can do this, and if your load is really asymmetrical and much quieter at night, then it may well make sense. It may also be unnecessary, as there is an auto-vacuum feature.
Another problem is that vacuum full compacts the database, it reduces database size on disk, but doesn't mean it makes database faster, often it might actually reduce performance.
Vacuum full might be useful in scenarios where you want to reclaim space, because autovacuum was not tuned correctly and tables get out of hand, if you need to run vacuum full frequently you should tune autovacuum to run more frequently.
Not saying do it all the time, but it is important to use surgically. You can easily calculate wasted table space
https://www.citusdata.com/blog/2017/10/20/monitoring-your-bl...
When it gets to be too big, it's a good time to do a vacuum full. I normally do it a few times a year on a few giant tables. Yes it locks up a table for a few minutes, but it is a big win and totally worth it.
A common misconception about (auto) vacuum is, that you need to turn it off, to avoid performance problems.
The truth is: you need to make it more aggressive (= run it more frequently) if you have problems with the (additional) I/O load it generates.
@pg-gadfly's link answered it for me:
> VACUUM creates a substantial amount of I/O traffic, which can cause poor performance for other active sessions.
Their wiki is pretty amazing source for postgres's operation: https://www.postgresql.org/docs/12/routine-vacuuming.html
I immediately got some warnings in pgadmin that some tables need to be vacuumed. Is this really necessary? Can i just vacuum everything at night on a cronjob?