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
Thepdb.verify_index function performs structural integrity checks on a ParadeDB index:
Example Output
Heap Reference Validation
To verify that all indexed entries still exist in the heap table, use theheapallindexed option:
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.
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: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 topg_amcheck --on-error-stop):
Parallel Verification
A singleverify_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 thesegment_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 SQLLIKE 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
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.