Skip to main content
ParadeDB provides amcheck-style index verification functions to detect corruption and validate the structural integrity of ParadeDB indexes. These functions are useful for:
  • Proactive corruption detection before issues become critical
  • Validating index health after hardware failures or unexpected shutdowns
  • Verifying backup integrity
  • Debugging index-related issues

Basic Verification

The pdb.verify_index function performs structural integrity checks on a ParadeDB index:
This returns a table with three columns:

Example Output

Heap Reference Validation

To verify that all indexed entries still exist in the heap table, use the heapallindexed option:
This adds an additional check that validates every indexed ctid (tuple identifier) references a valid row in the table. This is particularly useful for detecting index entries that reference deleted or non-existent rows.
The heapallindexed option can be slow on large indexes as it must verify every document. Consider using sample_rate for quick spot checks on large indexes.

Sampling for Large Indexes

For large indexes, you can check a random sample of documents instead of all documents:

Verification Settings

Progress Reporting

For long-running verifications, enable progress reporting to see status updates:
Progress messages are emitted via Postgres’s NOTICE channel.

Verbose Mode

For detailed logging including segment-by-segment progress and resume hints, enable verbose mode:

Stopping on First Error

To stop verification immediately when the first error is found (similar to pg_amcheck --on-error-stop):

Parallel Verification

A single verify_index call processes segments sequentially within one Postgres backend. For very large indexes, you can distribute verification across multiple database connections by specifying which segments each connection should check using the segment_ids parameter. This allows you to utilize multiple CPU cores by running verification in parallel processes.

Listing Segments

First, list all segments in the index:

Verifying Specific Segments

Then, verify specific segments using the segment_ids parameter:

Distributing Verification Across Workers

Distribute verification across N workers:

Verifying All ParadeDB Indexes

To verify all ParadeDB indexes in the database at once:

Filtering by Pattern

Filter indexes by schema or name pattern (using SQL LIKE syntax):

Listing All ParadeDB Indexes

To see all ParadeDB indexes in the database with summary statistics:

Inspecting Index Creation Time

To see when the index was built:
SQL
Build-time stamping is supported on ParadeDB 0.24.2 and up. Indexes created before upgrading to 0.24.2 will return NULL.

Function Reference

pdb.verify_index

Verifies a single ParadeDB index. Parameters Return Columns

pdb.verify_all_indexes

Verifies all ParadeDB indexes in the database. Parameters Return Columns

pdb.index_segments

Lists all segments in a ParadeDB index. Parameters Return Columns

pdb.indexes

Lists all ParadeDB indexes in the database. Parameters None. Return Columns

paradedb.index_created_at

Inspects when a ParadeDB index was built. Parameters Return Value Returns the index creation time as a timestamp with time zone, or NULL for indexes created before upgrading to ParadeDB 0.24.2.