If I do
SELECT count(*) FROM MILLION
if takes like 2 minutes to return the answer (which is 1,000,000)
During that time is seems to automatically execute the ANALYZE command, since SQLITE_STAT1 appears when the above query completes
Subsequent calls to the same above query return < 1/2 second… makes sense… it has the stats…
Yet, if I DROP the SQLITE_STAT1 table, and manually run the ANALYZE command it , that runs in 0.60 seconds
and the COUNT takes about the same… for a total of 1.2 seconds
So anyone know why the COUNT without a previous Analyze takes 100x longer? I would have expected on the order of 1.2 seconds (the combined of doing the Analyze followed by COUNT