I would like a version of the ANALYZE command which drops all the tables that 
ANALYZE creates, then updates the query planner so that it knows no stats are 
available.  This command is intended to help with

A) automated testing and time-trials
B) cleanup for transporting datasets from one setup to another
C) cleanup for when changing compilation options

It should delete not just the tables that ANALYZE in its current mode would 
create, but also those which might have been created by other compilation 
options such as SQLITE_ENABLE_STAT3.  If no schema or table name is supplied, 
dropping all tables with names starting with 'sqlite_stat' is fine.

The current syntax for ANALYZE is

ANALYZE [schema-name.table-or-index-name]

I see no need to implement ANALYZE REMOVE for individual tables or indices, so 
I propose that this new command be

ANALYZE [schema-name] REMOVE

This is my best idea but it does present ambiguity if you have a schema called 
REMOVE, and I'm happy to accept alternative ideas.  Or you may prefer 'DROP' to 
'REMOVE' or have some completely different idea about syntax.

PS: For those interested I currently use the following sequence:

DROP TABLE IF EXISTS sqlite_stat1;
DROP TABLE IF EXISTS sqlite_stat2;
DROP TABLE IF EXISTS sqlite_stat3;
DROP TABLE IF EXISTS sqlite_stat4;
ANALYZE sqlite_master;

Simon.

Reply via email to