Skip to content

Implement VACUUM FULL support for OrioleDB tables.#739

Open
Serge-sudo wants to merge 1 commit into
orioledb:mainfrom
Serge-sudo:vacuum-full
Open

Implement VACUUM FULL support for OrioleDB tables.#739
Serge-sudo wants to merge 1 commit into
orioledb:mainfrom
Serge-sudo:vacuum-full

Conversation

@Serge-sudo

@Serge-sudo Serge-sudo commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

The operation recreates the table and all associated structures (indexes, bridges, etc.) from scratch, effectively compacting the storage. As a result, all dead tuples and empty space are removed, eliminating fragmentation and reclaiming disk space.

uplink -> orioledb/postgres#48

The operation recreates the table and all associated structures
(indexes, bridges, etc.) from scratch, effectively compacting the
storage. As a result, all dead tuples and empty space are removed,
eliminating fragmentation and reclaiming disk space.

Copilot AI left a comment

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.

Pull request overview

Adds OrioleDB support for VACUUM FULL by wiring a new table-AM clustering/rebuild routine and updating the test suite to validate the behavior.

Changes:

  • Implement TableAmRoutine.relation_cluster for OrioleDB to rebuild table metadata and indexes during VACUUM FULL.
  • Remove the prior utility-command guard that rejected VACUUM FULL on OrioleDB relations.
  • Add/adjust regression + testgres tests and register the new regression test in REGRESSCHECKS.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/tableam/handler.c Adds orioledb_relation_cluster() and hooks it into the TableAM routine.
src/catalog/ddl.c Removes the utility-layer block that previously errored on VACUUM FULL for OrioleDB tables.
src/catalog/indices.c Relaxes an assertion in drop_primary_index() (now early-return) and introduces minor style change.
test/t/vacuum_test.py Adds testgres coverage for VACUUM FULL on OrioleDB tables (with/without PK).
test/t/not_supported_yet_test.py Updates the “not supported yet” test to expect VACUUM FULL to work.
test/sql/vacuum_full.sql New regression SQL test for VACUUM FULL effects on OrioleDB internal structures.
test/expected/vacuum_full.out Expected output for the new regression test.
Makefile Adds vacuum_full to REGRESSCHECKS.
ci/filter_isolation_diff.py Removes now-obsolete isolation diff filter for the old VACUUM FULL not supported error.
Comments suppressed due to low confidence (4)

test/t/not_supported_yet_test.py:168

  • This test switched from VACUUM (FULL, VERBOSE) to VACUUM FULL, which reduces coverage of VACUUM option parsing/output paths. If VERBOSE is now supported for OrioleDB, consider keeping the original VACUUM (FULL, VERBOSE) form here (and in the mixed-table case) to ensure those options are exercised too.
		# VACUUM FULL works for orioledb tables
		node.safe_psql("""
			VACUUM FULL o_test_1;
		""")

		# VACUUM FULL works for mixed table lists (orioledb + heap)
		node.safe_psql("""
			VACUUM FULL pg_test_1, o_test_1;
		""")

test/sql/vacuum_full.sql:4

  • The script creates a dedicated schema (CREATE SCHEMA orioledb;) and installs pageinspect, but it never drops the schema or the pageinspect extension. Other regression SQL files typically clean up with DROP EXTENSION ... and DROP SCHEMA ... at the end; please add corresponding cleanup here (and/or use a test-specific schema name + set search_path) to avoid leaving objects behind when tests are run individually or re-ordered.
CREATE SCHEMA orioledb;
CREATE EXTENSION orioledb SCHEMA orioledb;
CREATE EXTENSION pageinspect;

src/tableam/handler.c:1035

  • verbose is currently unused in orioledb_relation_cluster(), which can trigger unused-parameter warnings in builds. Either use it (e.g., emit progress logging when verbose is true) or explicitly mark it unused.
static void
orioledb_relation_cluster(Relation tbl, bool verbose)
{

test/t/vacuum_test.py:243

  • The test comment says the secondary index still works after VACUUM FULL, but the query filters on the primary key (val_1 = 42) and doesn’t exercise the newly-created secondary index on val_2. Consider changing the assertion to force/use the secondary index (e.g., query by val_2 with seqscan disabled or assert the plan uses the index) so the test actually validates secondary-index rebuild behavior.
		# Index still works after VACUUM FULL
		result = node.execute(
		    "SELECT val_2 FROM o_test_1 WHERE val_1 = 42;")
		self.assertEqual(result[0][0], 52)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tableam/handler.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants