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.

Options

Sampling for Large Indexes

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

Progress Reporting

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

Verbose Mode

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

Stop 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 PostgreSQL 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:

Automation Example

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:

Index Build Time

To see the wall-clock time a ParadeDB index was built at:
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.

pdb.verify_all_indexes

Verifies all ParadeDB indexes in the database.

pdb.index_segments

Lists all segments in a ParadeDB index. Returns:

pdb.indexes

Lists all ParadeDB indexes in the database. Returns:

paradedb.index_created_at

Returns the wall-clock time the given ParadeDB index was built. Supported on ParadeDB 0.24.2 and up; indexes created before upgrading to 0.24.2 return NULL. Returns a timestamp with time zone.