New in v26.1: The INSPECT runs a data consistency validation job against a table or database and records any errors it finds. To display errors recorded by an inspection job, use .INSPECT is the generally available replacement for the deprecated EXPERIMENTAL SCRUB command.
INSPECT is used to verify data integrity. It does not automatically repair errors.
Optional. Run the inspection against a historical read timestamp using INSPECT ... AS OF SYSTEM TIME {expr}. For an example, see INSPECT at a specific timestamp. For more information about historical reads, see .
Inspect all supported index types in the target table or database. This is the default.
INDEX ({index_name} [, ...])
Inspect only the specified indexes. Note that INDEX ALL and this option are mutually exclusive.
DETACHED
Run INSPECT in detached mode so the statement returns to the SQL client after the job is created (instead of waiting for the job to complete). For an example, see INSPECT a table without waiting for completion. This option allows INSPECT to run inside a .
By default, INSPECT causes the SQL client to wait for the background job to complete and returns a NOTICE with the job ID. To return to the client as soon as the job is created (without waiting for it to finish), use the DETACHED option.
INSPECT can be run inside a if the DETACHED option is used. Otherwise, it needs to be run in an .
INSPECT runs with low priority under the subsystem and may take time on large datasets. Plan to run it during periods of lower system load.
The following index types are unsupported:
Unsupported index types are automatically skipped when using the default INDEX ALL behavior. If an unsupported index type is directly requested using INDEX {index_name}, the statement will fail before starting.