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
Get Using SQLite now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.