analysis_limit
Approximate rows ANALYZE examines per index; 0 means all rows.
- Padrão
0 (no limit)- Range
- 0 or more rows
- Restart needed
- Não
- Default checked on
- SQLite 3.5x
O que faz
Lets ANALYZE finish quickly on large databases while still giving the planner usable statistics. Available from SQLite 3.32. From 3.46, PRAGMA optimize applies its own temporary limit, so it no longer needs this setting.
Valor padrão
0 (no limit). 0 (a stock SQLite 3.5x build).
Check the current value
PRAGMA analysis_limit; SELECT * FROM pragma_analysis_limit; -- table-valued form, usable in queries
Change it
PRAGMA analysis_limit = 1000; -- this connection only
No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.
When to change it
Before running ANALYZE directly on a large database, or before PRAGMA optimize on SQLite older than 3.46; the SQLite docs suggest values of 100 to 1000.
What can go wrong
Statistics from a sample can be less accurate on skewed data.
Questions about analysis_limit
What is the default value of analysis_limit in SQLite?
0 (no limit). 0 (a stock SQLite 3.5x build).
Does changing analysis_limit require a restart?
No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.
When should I change analysis_limit?
Before running ANALYZE directly on a large database, or before PRAGMA optimize on SQLite older than 3.46; the SQLite docs suggest values of 100 to 1000.
Back to all SQLite settings, or check the SQLite manual for every option.
Check analysis_limit on your own server
SQLly runs the query above against SQLite and the other engines in this reference, from one desktop app on macOS, Windows and Linux.