REINDEXcollation_name
; REINDEXdatabase_name
.table_name
; REINDEXdatabase_name
.index_name
;
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.