REBUILD INDEX

Rebuilds a row-level index from scratch at the parent table's current version, replacing the stale index data with a fresh full build.

Category: indexingDeltaForge extension

Syntax

REBUILD INDEX <name> ON TABLE <table>

Description

## Overview REBUILD INDEX scans the parent table at its current version and rewrites the child index Delta table from scratch. Use it to bring a stale manually maintained index back in sync, or after a large bulk load when the cost of incremental maintenance exceeds a full rebuild. ## Behavior - The rebuild reads every parent file and produces a new child index Delta table at the parent's current version. The previous index data is replaced atomically. - The rebuild commits a new version on both the parent (registry update) and the child Delta table (full overwrite). - An index with `auto_update = true` typically does not need REBUILD; the auto-maintenance pass keeps it in sync. Use REBUILD only when an incremental maintenance pass has fallen behind, or after operations that bypass the maintenance hook. - The rebuild is sequential and reads the entire parent table. Cost scales linearly with the number of indexed rows. ## Access Control No specific privilege is required beyond table-level access in the standalone SQL layer. In a Control Plane deployment the table's MODIFY privilege governs index rebuilds. ## Compatibility DeltaForge extension.

Parameters

NameTypeDescription
nameSpecifies the index name to rebuild.
tableSpecifies the parent Delta table that owns the index.

Examples

-- Rebuild after a bulk load on the parent table
INSERT INTO orders SELECT * FROM staging.orders_today;
REBUILD INDEX idx_customer ON TABLE orders;

Pitfalls

See Also

Open in interactive docs →   DeltaForge home →