SQLite Forum

Request for comment: New ANALYZE syntax
Login
I'd try and stick within existing keywords, *maybe adding* `BRIEF` and/or `VERILY`, but there is already `FULL` to mean verily. 

Use PRAGMA as the model for any name=value options

    ANALYZE [BRIEF | FULL] schema.table WITH/or/USING name, name=value,... LIMIT expr OFFSET expr

FULL or ALL could be aliased, but FULL seems to make more sense, and `ALL` might be the all options option, instead of listing the name value pairs.  In that case `NOTHING` might be the opposite of ALL when doing a full scan without any extra stats.

You already have LIMIT, so that seems reasonable for setting sample size, including a starting OFFSET (if that seems like a sane thing to do).

WITH or USING, should almost be interchangeable, allow either?  Easier on the brain and might save some reference lookups.  VALUES would work there too, but I don't think VALUES ever uses name/value pairs like the PRAGMA syntax.

If BRIEF/FAST is added, the keyword `ADD` might read well for adding pragma style options to an analysis. Maybe `EXCLUDE` (or `IGNORE`) to turn off some outliers from a FULL/VERILY pass.

When no BRIEF or FULL is mentioned it could allow for a middle ground 'normal-ish' option, but probably safer to just mean current behaviour.

Have good