Skip to main content

REINDEX

The REINDEX statement deletes and recreates indexes from scratch. It is useful when a collation sequence definition has changed, or to rebuild an index that may have become out of date.

Syntax

Description

When a single unqualified name is given, Turso resolves it in the order collation → table → index: if the name matches a collation sequence, all indexes using that collation are rebuilt; otherwise it is treated as a table or index name.

Examples

Limitations

REINDEX returns an error in the following cases:
  • When the connection is in MVCC mode (journal_mode=mvcc).
  • On WITHOUT ROWID tables.
  • For custom index methods that have no backing B-tree, such as FTS and vector indexes.
  • When PRAGMA query_only is enabled.

See Also