Expand description
SQLite Statistics Virtual Tables
Implements sqlite_stat1, sqlite_stat2, sqlite_stat3, and sqlite_stat4 for SQLite
compatibility. These tables store index statistics computed by the ANALYZE command.
Currently, only sqlite_stat1 is fully implemented, which is the most commonly used.
Schema:
CREATE TABLE sqlite_stat1 (
tbl TEXT, -- table name
idx TEXT, -- index name (NULL for table statistics)
stat TEXT -- space-separated statistics (row_count selectivity...)
);Reference: https://www.sqlite.org/fileformat2.html#stat1tab
Functionsยง
- execute_
sqlite_ stat1_ query - Execute a sqlite_stat1 query
- get_
sqlite_ stat1_ table_ schema - Get the schema for sqlite_stat1
- is_
sqlite_ stat1_ table - Check if a table reference is specifically sqlite_stat1
- is_
sqlite_ stat_ table - Check if a table reference is a sqlite_stat table