Skip to main content
Odoo Community Association

Database Autovacuum Tuning

Alpha License: LGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

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.

Table of contents

Usage

  1. Install the module on the database you want to tune.

  2. Go to Settings > Technical > Database Structure > Database Autovacuum Tuning and review the recommended thresholds and scale factors.

  3. If needed, override the defaults using the following system parameters:

    • database_autovacuum_tuning.autovacuum_vacuum_max_threshold

    • database_autovacuum_tuning.autovacuum_vacuum_analyze_max_threshold

  4. 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
    )
  5. Monitor vacuum activity and table bloat, then adjust the settings if your workload changes.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Camptocamp

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

This module is part of the OCA/server-tools project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Release files for odoo-addon-database-autovacuum-tuning 18.0.1.0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo-addon-database-autovacuum-tuning 18.0.1.0.1.3
File Interpreter ABI Platform
odoo_addon_database_autovacuum_tuning-18.0.1.0.1.3-py3-none-any.whl Python 3 none any Details

Release files / odoo_addon_database_autovacuum_tuning-18.0.1.0.1.3-py3-none-any.whl

Download URL odoo_addon_database_autovacuum_tuning-18.0.1.0.1.3-py3-none-any.whl
Size 31.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96dcd92539b7ea111356388f08469cc707dd616e3fb7145e4140d6c563522e90
BLAKE2b-256 checksum
How to use checksums
42227f65924892cf64f9567b50b3d19a94e314bfab3c7e59a3559506daa1a354
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

18.0.1.0.1.3 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page