Added PostgreSQL v13 VACUUM PARALLEL option support #1208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PostgreSQL v13 VACUUM PARALLEL option support
Description
This PR adds support for the PARALLEL option of VACUUM commands in PostgreSQL 13+. The PARALLEL option was introduced in PostgreSQL 13 and allows specifying number of parallel worker processes to use when running a parallel vacuum operation.
Changes made
Added PostgreSQL version detection in
PostgresGlobalState.java
-Added a
majorVersion
field to store the server's major version, implementedgetMajorVersion()
method that extracts the major version fromserver_version_num
and updatedsetConnection()
to initialize the major version when connectingEnhanced
PostgresVacuumGenerator.java
to support the PARALLEL option -Added PARALLEL option to the list of vacuum options when PostgreSQL version is 13 or higher , ensured PARALLEL option always has valid integer value (between 0-4 for testing) and added error handling for the "VACUUM option PARALLEL cannot be used with FULL" error
Testing
Tested with PostgreSQL 13.20 to verify:
Related Issues
Resolves one of the pending items from #912
Related to #1040 "[Postgres][v13] Add PARALLEL option for VACUUM"