On 2015-09-10 09:05 AM, Ludovic Aubert wrote: > Hello, > > I am facing a strange issue: > I am calling sqlite3_execute(db, "ANALYZE;") from a C program after a bunch > of CREATE and INSERT, > Then this program exits. > Another exe tries to perform some selects into the db, but it seems like > ANALYZE had no effect and the queries take about 10 mn to complete. > > Now if I run ANALYZE on the db from sqlitestudio, the selects get blazing > fast: about 1 second or less.
Analyze creates a stats table in the DB (sqlite_statX). Please dump the stats table after running analyze from your program, and again after running it from the db gui program. Do both cause such a table? What are the differences?