Name
REINDEX — Rebuild an index from source data
Syntax

Common Usage
REINDEXcollation_name; REINDEXdatabase_name.table_name; REINDEXdatabase_name.index_name;
Description
The REINDEX command deletes the data within an
index and rebuilds the index structure from the source table
data. The table referenced by the index is not changed.
REINDEX is most frequently used when the
definition of a collation sequence has changed and all of the
indexes that use that collation must be rebuilt. This ensures
that the index order correctly matches the order defined by the
collation.
If a collation name is provided, all indexes that use that collation, in all attached databases, will be reindexed. If a table name is given, all the indexes associated with that table will be reindexed. If a specific index name is given, just that index will be rebuilt.
See Also
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access