Vacuuming is an important PostgreSQL database maintenance operation. It is used to
reclaim storage space occupied by updated or deleted rows to avoid table or index
bloat. It is also used for freezing transaction IDs to prevent transaction ID wraparound and for updating the table statistics.
To automate the process of vacuuming and collectively updating the table statistics,
AlloyDB Omni supports adaptive autovacuum. Adaptive autovacuum enables
automatic adjustment of vacuum workload when your workload changes, removes dead
tuples, and updates table statistics.
Autovacuum ensures a reliable and consistent application transactional performance
and maintains high availability of the system by preventing transaction ID wraparound.
By default, AlloyDB Omni enables adaptive autovacuum. You can disable
or modify adaptive autovacuum on AlloyDB Omni by using database flags.
Benefits
Adaptive autovacuum offers the following benefits:
Automatic adjustment of resources. AlloyDB Omni automatically adjusts
resources such as CPU, I/O, number of vacuum processes, and memory for the vacuum
process based on the real time status of the workload and available resources
without affecting the system performance.
Prevention of transaction ID wraparound. AlloyDB Omni monitors the
vacuum progress and transaction ID consumption speed. When necessary,
AlloyDB Omni throttles its transaction ID consumption by
vacuuming every table in the database, preventing transaction ID wraparound.
Periodic vacuum for tables. AlloyDB Omni triggers autovacuum
based on the number of dead tuples and the pages that need to be
scanned. It removes dead tuples in a timely manner to avoid table or index bloat.
Automatic detection of blockers. AlloyDB Omni automatically detects
blockers such as long running transactions, orphan prepared transactions, orphan
replication slots, and shows warning messages similar to the following in the
postgres log:
By default, adaptive autovacuum is enabled on AlloyDB Omni. You can
disable adaptive autovacuum by setting an instance's enable_google_adaptive_autovacuum
database flag to off.
AlloyDB Omni supports several standard PostgreSQL database flags related
to vacuum and autovacuum, for example, vacuum_cost_delay and autovacuum_vacuum_cost_delay.
You don't need to set values in any of these flags for adaptive autovacuum to work
because adaptive autovacuum adapts and optimizes its behavior to your real workloads.
If you set values in these flags, then adaptive autovacuum adjusts its behavior
to take your preferences into account.
To see the complete list of supported PostgreSQL database flags related to vacuum
and autovacuum, see vacuum flags
and autovacuum flags.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eAlloyDB Omni supports adaptive autovacuum, which automates vacuuming and table statistics updates, adapting to workload changes.\u003c/p\u003e\n"],["\u003cp\u003eAdaptive autovacuum automatically adjusts resources like CPU, I/O, and memory, optimizing the vacuum process without impacting system performance.\u003c/p\u003e\n"],["\u003cp\u003eThis feature prevents transaction ID wraparound by monitoring vacuum progress and transaction ID consumption, triggering full database vacuuming when needed.\u003c/p\u003e\n"],["\u003cp\u003eAlloyDB Omni's adaptive autovacuum performs timely dead tuple removal, preventing table and index bloat.\u003c/p\u003e\n"],["\u003cp\u003eWhile adaptive autovacuum works automatically, it can be disabled or further configured using standard PostgreSQL vacuum and autovacuum database flags.\u003c/p\u003e\n"]]],[],null,["# Configure adaptive autovacuum\n\nSelect a documentation version: Current (16.8.0)keyboard_arrow_down\n\n- [Current (16.8.0)](/alloydb/omni/current/docs/adaptive-autovacuum)\n- [16.8.0](/alloydb/omni/16.8.0/docs/adaptive-autovacuum)\n- [16.3.0](/alloydb/omni/16.3.0/docs/adaptive-autovacuum)\n- [15.12.0](/alloydb/omni/15.12.0/docs/adaptive-autovacuum)\n- [15.7.1](/alloydb/omni/15.7.1/docs/adaptive-autovacuum)\n- [15.7.0](/alloydb/omni/15.7.0/docs/adaptive-autovacuum)\n\n\u003cbr /\u003e\n\nThis page provides an overview of AlloyDB Omni adaptive autovacuum and describes how to configure it.\n\n\u003cbr /\u003e\n\nVacuuming is an important PostgreSQL database maintenance operation. It is used to\nreclaim storage space occupied by updated or deleted rows to avoid table or index\nbloat. It is also used for freezing transaction IDs to [prevent transaction ID wraparound](https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND) and for updating the table statistics.\n\nFor more information about vacuuming, see [Routine vacuuming](https://www.postgresql.org/docs/current/routine-vacuuming.html).\n\nTo automate the process of vacuuming and collectively updating the table statistics,\nAlloyDB Omni supports adaptive autovacuum. *Adaptive autovacuum* enables\nautomatic adjustment of vacuum workload when your workload changes, removes dead\ntuples, and updates table statistics.\n\nAutovacuum ensures a reliable and consistent application transactional performance\nand maintains high availability of the system by preventing transaction ID wraparound.\n\nBy default, AlloyDB Omni enables adaptive autovacuum. You can disable\nor modify adaptive autovacuum on AlloyDB Omni by [using database flags](#view-cluster).\n\nBenefits\n--------\n\nAdaptive autovacuum offers the following benefits:\n\n- **Automatic adjustment of resources.** AlloyDB Omni automatically adjusts\n resources such as CPU, I/O, number of vacuum processes, and memory for the vacuum\n process based on the real time status of the workload and available resources\n without affecting the system performance.\n\n- **Prevention of transaction ID wraparound.** AlloyDB Omni monitors the\n vacuum progress and transaction ID consumption speed. When necessary,\n AlloyDB Omni throttles its transaction ID consumption by\n vacuuming every table in the database, preventing transaction ID wraparound.\n\n- **Periodic vacuum for tables.** AlloyDB Omni triggers autovacuum\n based on the number of dead tuples and the pages that need to be\n scanned. It removes dead tuples in a timely manner to avoid table or index bloat.\n\n- **Automatic detection of blockers.** AlloyDB Omni automatically detects\n blockers such as long running transactions, orphan prepared transactions, orphan\n replication slots, and shows warning messages similar to the following in the\n `postgres` log:\n\n Found a backend process PROCESS_ID with a long running transaction whose transaction\n id age AGE is larger than or equal to the transaction age threshold AGE_THRESHOLD.\n\nConfigure adaptive autovacuum\n-----------------------------\n\nBy default, adaptive autovacuum is enabled on AlloyDB Omni. You can\ndisable adaptive autovacuum by setting an instance's `enable_google_adaptive_autovacuum`\ndatabase flag to `off`.\n\nAlloyDB Omni supports several standard PostgreSQL database flags related\nto vacuum and autovacuum, for example, `vacuum_cost_delay` and `autovacuum_vacuum_cost_delay`.\nYou don't need to set values in any of these flags for adaptive autovacuum to work\nbecause adaptive autovacuum adapts and optimizes its behavior to your real workloads.\nIf you set values in these flags, then adaptive autovacuum adjusts its behavior\nto take your preferences into account.\n\nTo see the complete list of supported PostgreSQL database flags related to vacuum\nand autovacuum, see [vacuum flags](https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-VACUUM-COST-DELAY)\nand [autovacuum flags](https://www.postgresql.org/docs/current/runtime-config-autovacuum.html)."]]