Skip to content

[18.0][ADD] database_autovacuum_tuning#3523

Merged
OCA-git-bot merged 1 commit intoOCA:18.0from
camptocamp:18.0-add-database_autovacuum_tuning
Apr 30, 2026
Merged

[18.0][ADD] database_autovacuum_tuning#3523
OCA-git-bot merged 1 commit intoOCA:18.0from
camptocamp:18.0-add-database_autovacuum_tuning

Conversation

@santostelmo
Copy link
Copy Markdown
Contributor

Database Autovacuum Tuning helps administrators keep PostgreSQL healthy by
exposing recommended autovacuum settings in Odoo. It provides guidance 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.

@santostelmo santostelmo marked this pull request as draft February 18, 2026 08:28
@santostelmo santostelmo force-pushed the 18.0-add-database_autovacuum_tuning branch from 08b065a to 04cc152 Compare February 18, 2026 10:09
@santostelmo santostelmo marked this pull request as ready for review February 18, 2026 10:39
@santostelmo santostelmo force-pushed the 18.0-add-database_autovacuum_tuning branch from 04cc152 to afe120e Compare February 18, 2026 10:41
Comment thread database_autovacuum_tuning/data/config_parameter.xml Outdated
Comment thread database_autovacuum_tuning/views/menu.xml Outdated
@santostelmo santostelmo force-pushed the 18.0-add-database_autovacuum_tuning branch 2 times, most recently from 27d3824 to 22accc3 Compare February 18, 2026 12:30
@santostelmo santostelmo marked this pull request as draft February 18, 2026 13:34
@santostelmo santostelmo marked this pull request as ready for review February 18, 2026 13:36
@santostelmo santostelmo marked this pull request as draft February 18, 2026 13:37
@santostelmo santostelmo force-pushed the 18.0-add-database_autovacuum_tuning branch from c6f5a98 to 22accc3 Compare February 18, 2026 13:51
@santostelmo
Copy link
Copy Markdown
Contributor Author

santostelmo commented Feb 18, 2026

CI failling on auditlog module but don't see any relation with this PR:
Test: auditlog.tests.test_auditlog
AssertionError: Found unexpected attributes on res.groups: export_data unlink write auditlog_ruled_read auditlog_ruled_create auditlog_ruled_write read auditlog_ruled_unlink auditlog_ruled_export_data create

Copy link
Copy Markdown

@wouitmil wouitmil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@santostelmo santostelmo force-pushed the 18.0-add-database_autovacuum_tuning branch from 22accc3 to 3e9cffc Compare February 19, 2026 05:56
@santostelmo santostelmo marked this pull request as ready for review February 19, 2026 08:10
@santostelmo santostelmo force-pushed the 18.0-add-database_autovacuum_tuning branch from 3e9cffc to d20f0cd Compare February 23, 2026 05:44
Comment thread database_autovacuum_tuning/models/database_autovacuum_tuning.py Outdated
Comment thread database_autovacuum_tuning/models/database_autovacuum_tuning.py Outdated
Comment thread database_autovacuum_tuning/models/database_autovacuum_tuning.py Outdated
Comment thread database_autovacuum_tuning/models/database_autovacuum_tuning.py Outdated
Comment thread database_autovacuum_tuning/models/database_autovacuum_tuning.py Outdated
Comment thread database_autovacuum_tuning/readme/USAGE.md Outdated
Comment thread database_autovacuum_tuning/security/ir.model.access.csv Outdated
Comment thread database_autovacuum_tuning/tests/test_database_autovacuum_tunning.py Outdated
Comment thread database_autovacuum_tuning/tests/test_database_autovacuum_tunning.py Outdated
Comment thread database_autovacuum_tuning/tests/test_database_autovacuum_tunning.py Outdated
@santostelmo santostelmo force-pushed the 18.0-add-database_autovacuum_tuning branch 3 times, most recently from 9c69e00 to 772221f Compare February 23, 2026 11:37
Comment thread database_autovacuum_tuning/models/database_autovacuum_tuning.py Outdated
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="cron_database_autovacuum_tuning" model="ir.cron">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we simply use the @autovacuum decorator?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could but we probably will be mixing 2 goals:

  1. @autovacuum removing obsolete or temporary data
  2. cron_database_autovacuum_tuning tune vacuum config parameter on tables

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @santostelmo this would be confusing the purpose of both are totally different.

Comment thread database_autovacuum_tuning/models/database_autovacuum_tuning.py
@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@santostelmo santostelmo force-pushed the 18.0-add-database_autovacuum_tuning branch from 7ade591 to 8b8f86f Compare February 26, 2026 14:16
Comment thread database_autovacuum_tuning/__manifest__.py
@santostelmo santostelmo force-pushed the 18.0-add-database_autovacuum_tuning branch from 8b8f86f to ecb4fe8 Compare February 27, 2026 08:53
@hbrunn
Copy link
Copy Markdown
Member

hbrunn commented Mar 14, 2026

an existing approach is https://github.com/OCA/server-tools/tree/16.0/postgres_vacuum that makes vacuum an explicit action. maybe combine both?

@gurneyalex
Copy link
Copy Markdown
Member

an existing approach is https://github.com/OCA/server-tools/tree/16.0/postgres_vacuum that makes vacuum an explicit action. maybe combine both?

Both can coexist, but the goal here is to rely on autovacuum, which is what I understand your module wants to avoid ("autovacuum is not recommended for busy databases, it can be a better choice to schedule this process manually"). In our experience, autovacuum works fine, especially if you manage to get rid of super long "idle in transaction" and "active" connections to the database, which essentially prevent autovacuum from running. The tuning that this module performs is another key factor to get a performant autovacuum as the default settings will not give good results for large tables with many updates.

It may well be that our use cases do not match yours and the patterns of transaction that lead to the postgres_vacuum addon are indeed not compatible with autovacuum. Both addons serve different purposes, it should be possible to install them together without any negative consequences, so I would be tempted to let them live in parallel.

@gurneyalex
Copy link
Copy Markdown
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 18.0-ocabot-merge-pr-3523-by-gurneyalex-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 678bcee into OCA:18.0 Apr 30, 2026
7 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 234d851. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants