OPTIMIZE
Quickly updates database statistics that may help optimize queries that have been run by this Database since it was opened. The more queries that have been run, the more effective this will be, but it tries to do its work quickly by scanning only portions of indexes. (Runs SQLite PRAGMA analysis_limit=400; PRAGMA optimize
.)
This operation is also performed automatically when a Database is closed.