SQL As Understood By SQLite
ANALYZE
sql-statement ::= | ANALYZE |
sql-statement ::= | ANALYZE database-name |
sql-statement ::= | ANALYZE [database-name .] table-name |
The ANALYZE command gathers statistics about indices and stores them in a special tables in the database where the query optimizer can use them to help make better index choices. If no arguments are given, all indices in all attached databases are analyzed. If a database name is given as the argument, all indices in that one database are analyzed. If the argument is a table name, then only indices associated with that one table are analyzed.
The initial implementation stores all statistics in a single table named sqlite_stat1. Future enhancements may create additional tables with the same name pattern except with the "1" changed to a different digit. The sqlite_stat1 table cannot be DROPped, but all the content can be DELETEd which has the same effect.