18.7. The Engine Vacuum Tool

download PDF

18.7.1. The Engine Vacuum Tool

The Engine Vacuum tool maintains PostgreSQL databases by updating tables and removing dead rows, allowing disk space to be reused. See the PostgreSQL documentation for information about the VACUUM command and its parameters.
The Engine Vacuum command is engine-vacuum. You are required to log in as the root user and provide the administration credentials for the Red Hat Virtualization environment.
Alternatively, the Engine Vacuum tool can be run while using the engine-setup command to customize an existing installation:
$ engine-setup
[ INFO  ] Stage: Environment customization
Perform full vacuum on the engine database engine@localhost?
This operation may take a while depending on this setup health and the
configuration of the db vacuum process.
(Yes, No) [No]:
The Yes option runs the Engine Vacuum tool in full vacuum verbose mode.

18.7.2. Engine Vacuum Modes

Engine Vacuum runs in two modes, Standard and Full.

Standard Vacuum

Frequent standard vacuuming is recommended.
Standard vacuum removes dead row versions in tables and indexes and marks the space as available for future reuse. Frequently updated tables should be vacuumed on a regular basis. However, standard vacuum does not return the space to the operating system.
Standard vacuum, with no parameters, processes every table in the current database.

Full Vacuum

Full vacuum is not recommended for routine use, but should only be run when a significant amount of space needs to be reclaimed from within the table.
Full vacuum compacts the tables by writing a new copy of the table file with no dead space, thereby enabling the operating system to reclaim the space. Full vacuum can take a long time.
Full vacuum requires extra disk space for the new copy of the table, until the operation completes and the old copy is deleted. Because full vacuum requires an exclusive lock on the table, it cannot be run in parallel with other uses of the table.

18.7.3. Syntax for the Engine Vacuum

The basic syntax for the Engine Vacuum command is:
engine-vacuum [option]
Running the engine-vacuum command with no options performs a standard vacuum.
There are several parameters to further refine the engine-vacuum command.

General Options

-h --help
Displays information on how to use the engine-vacuum command.
Runs a standard vacuum, analyzes the database, and updates the optimizer statistics.
Analyzes the database and updates the optimizer statistics, without vacuuming.
Runs a full vacuum.
Runs in verbose mode, providing more console output.
-t [table_name]
Vacuums a specific table or tables.
engine-vacuum -f -v -t vm_dynamic -t vds_dynamic
Red Hat logoGithubRedditYoutubeTwitter


Try, buy, & sell


About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.