OdooWiki OCA HUB

Postgres vacuum

postgres_vacuum folder_open OCA/server-tools open_in_new
Extra Tools License: AGPL-3

This module adds a cronjob that vacuums or analyses postgres tables.

As postgres' autovacuum is not recommended for busy databases, it can be a better choice to schedule this process manually.

auto_awesome What this module does

AI-generated from the code · Odoo 16.0

Adds two scheduled jobs that clean up and refresh Odoo's database tables: one weekly analysis job and one monthly full vacuum job (inactive by default).

This module gives Odoo two automated maintenance jobs that keep the PostgreSQL database healthy without relying on PostgreSQL's own automatic cleanup, which is not recommended for busy databases.

  • A weekly job named "Analyze Postgresql Tables" runs automatically. It refreshes the database statistics used by the query planner, table by table, starting with the tables that were analyzed longest ago.
  • A monthly job named "Vacuum Postgresql Tables" is created but switched off by default. When enabled, it performs a full vacuum, reclaiming disk space and rewriting tables, again starting with the tables vacuumed longest ago.

Both jobs stop after 120 minutes so they do not run indefinitely, and they skip tables that are currently locked, so normal work can continue. If a single table fails, the job logs the error and moves on to the next one.

There are no new menus or screens: the jobs appear in the standard Scheduled Actions list (Settings > Technical > Scheduled Actions) where an administrator can enable, disable or reschedule them. The module only extends the existing ir.cron model and does not change any business documents.

Depends on

base

Text generated by AI (DeepSeek) from reading the Odoo 16.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 1 confirmed, 8 with no information of 9 versions.

Sources · Odoo 16.0

Confirmed on 2026-11-03 in branch 16.0 of OCA/server-tools.

terminal Installation and usage

OCA documentation · Odoo 16.0

To configure this module, you need to:

  • Go to Settings/Technical/Automation/Scheduled Actions
  • Select actions Vacuum Postgresql Tables and Analyze Postgresql Tables
  • Adapt the schedule to run at a time when your Odoo installation is least busy, take care that the analyze and vacuum cronjobs won't run simultaneously
  • Adapt the parameters to match your setting, but the defaults should be fine for most users
  • Note that the vacuum cronjob is inactive by default, because this is a potentially very heavy operation

To use this module, you need to:

  • Go to Settings/Technical/Automation/Scheduled Actions
  • Select action Vacuum Postgresql Tables
  • Click the Run Manually button

No verified information in OCA: Installation.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.