Recreate indexes from scratch


REINDEX collation name |
    ( [database-name .] table | index-name )


The REINDEX command is used to delete and recreate indexes from scratch. This is useful when the definition of a collation sequence has changed.

In the first form, all indexes in all attached databases that use the named collation sequence are recreated. In the second form, if [database-name .] { table-name | index-name } identifies a table, then all indexes associated with the table are rebuilt. If an index is identified, then only this specific index is deleted and recreated.

If no database-name is specified and there exists both a table or index and a collation sequence of the specified name, then indexes associated with the collation sequence only are reconstructed. This ambiguity may be dispelled by always specifying a database-name when reindexing a specific table or index.