Manually Vacuuming PostgreSQL during off-hours

XRAY: How to tune Xray for heavy loads?

AuthorFullName__c
Ariel Kabov
articleNumber
000004533
ft:sourceType
Salesforce
FirstPublishedDate
2019-08-25T06:48:45Z
lastModifiedDate
2022-11-12
VersionNumber
8
Xray triggers Vacuum for the “files” table in Postgres once a week.
This will by default occur exactly 1 week after the last time Xray has started.

In large-scale environments, the operation of a `vacuum full` can take up to several minutes. During this period Xray might not behave as expected.
To avoid that, you can manually invoke vacuuming during off-hours, thus even when Xray will `vacuum`, as the table was recently `vacuumed`, it shouldn’t take long.

One option to achieve this will be to use pg_cron to schedule these:
vacuum full files;
vacuum full root_files;