-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[framework] VACUUM FULL ANALYZE is now run once a week #3160
base: 15.0
Are you sure you want to change the base?
Conversation
…tConfiguredException is caught
$this->logger->info('Cron lock was released.'); | ||
} | ||
|
||
protected function waitUntilOtherCronModulesOff(): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those functions are just duplicated in our base:
waitUntilOtherCronModulesOff()
-> CronWatchCommand
lockAllCronModules()
-> CronLockCommand
maintenanceOn()
and maintenanceOff()
-> MaintenanceModeCommand
try { | ||
$this->waitUntilOtherCronModulesOff(); | ||
$this->maintenanceOn(); | ||
$this->makeVacuum(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the idea of making VACUUM FULL from the application. Additionally, you should run VACUUM FULL as an edge case and not regularly.
Postgres has AUTOVACUUM that should handle bloat in databases. If you have miswritten your application then you have to use VACUUM FULL. Running it periodically covers problems in your application.
Another view can be that ANALYSE rebuilds all statistics instead of updating them. So this means that this command can negatively impact the performance of some SQL commands.
I don't say we should entirely avoid using VACUUM FULL, but we should do that manually as an edge case.
There is an outdated but still relevant article about it: https://wiki.postgresql.org/wiki/VACUUM_FULL
VACUUM FULL ANALYZE
on the database once a week so we don't have to think about it and run it manually anymore.🌐 Live Preview: