Recreate indexes from scratch
Synopsis:
REINDEX collation name |
( [database-name .] table | index-name )
Description:
The REINDEX command is used to delete and recreate indexes from scratch.
This is useful when the definition of a collation sequence has changed.
The scope of the affected database indexes depends on the type of database object given to the command,
as summarized in the following behavioral rules:
- If you specify a collation_name, all the indexes in any attached databases that use
the specified collation sequence are recreated.
- If you specify a [database-name .] table-name combination,
all indexes associated with the table are rebuilt.
- If you specify a [database-name .] index-name combination,
only this specified index is deleted and recreated.
- If don't specify a database-name but there exists both a collation sequence and either a table or index
with the specified name, the indexes associated with the collation sequence are only reconstructed.
You can avoid this ambiguity by always specifying a database-name when reindexing a table or index.