Database Autovacuum Tuning helps administrators keep PostgreSQL healthy by exposing recommended autovacuum settings in Odoo. It provides guidance and documentation for sizing thresholds and scale factors so large, busy databases avoid table bloat and excessive vacuum lag. Use it to standardize autovacuum configuration across environments and speed up maintenance operations without manual tuning.
This module is mostly useful for PostgreSQL <= 17. PostgreSQL 18.0 introduces the autovacuum_vacuum_max_threshold parameter, which already provides the capability this module targets.
The pgstattuple extension must be installed on the database.
auto_awesome What this module does
AI-generated from the code · Odoo 18.0Automatically tunes PostgreSQL autovacuum settings on busy tables and keeps a log of what was changed. Administrators set the thresholds in Odoo settings; a daily job applies them.
This module helps database administrators keep PostgreSQL tables from bloating by applying per-table autovacuum settings automatically.
In Settings, under the Performance section, two new fields let administrators set the maximum number of updated or deleted rows (dead tuples) that should trigger a vacuum and a vacuum analyze. Default values are 100,000 and 50,000.
A scheduled job named "Database Autovacuum Tuning" runs once a day. It looks at tables in the public schema owned by the current database user and finds those whose dead-tuple count exceeds the vacuum threshold. For each such table it disables the default scale factors and sets fixed vacuum and analyze thresholds instead, so maintenance runs at predictable row counts rather than percentages.
Every table that gets adjusted is recorded in a new "Database Autovacuum Tuning" list, reachable from the Database Autovacuum Tuning menu. The list shows the table name, the vacuum threshold and the analyze threshold, and can be searched or grouped by name and creation date. Only users in the System group can access these records.
The module touches the res.config.settings screen and adds the database.autovacuum.tuning model. It relies on PostgreSQL statistics and requires the pgstattuple extension to be installed on the database.
Depends on
Models and fields (2)
- res.config.settings · extends an existing modelautovacuum_vacuum_max_threshold, autovacuum_vacuum_analyze_max_threshold
- database.autovacuum.tuning · new modelname, vacuum_threshold, analyze_threshold
Text generated by AI (DeepSeek) from reading the Odoo 18.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-03Confirmation status: 1 confirmed, 8 with no information of 9 versions.
Sources · Odoo 18.0
Confirmed on 2026-11-03 in branch 18.0 of OCA/server-tools.
terminal Installation and usage
OCA documentation · Odoo 18.0Usage
Source · Odoo 18.0- Install the module on the database you want to tune.
- Go to Settings > Technical > Database Structure > Database Autovacuum Tuning and review the recommended thresholds and scale factors.
- If needed, override the defaults using the following system parameters:
database_autovacuum_tuning.autovacuum_vacuum_max_thresholddatabase_autovacuum_tuning.autovacuum_vacuum_analyze_max_threshold- The configuration parameters are applied to tables by the daily cron job. When the number of dead tuples in a table exceeds the vacuum threshold, it applies the following configuration:
ALTER TABLE {schemaname}.{tablename} SET (
autovacuum_vacuum_scale_factor = 0,
autovacuum_vacuum_threshold = %s,
autovacuum_analyze_scale_factor = 0,
autovacuum_analyze_threshold = %s
)- Monitor vacuum activity and table bloat, then adjust the settings if your workload changes.
No verified information in OCA: Installation, Configuration.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
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.