Andrew Kravchuk
Andrew Kravchuk

Reputation: 396

SQLite prepared statements re-planning

Suppose I've prepared some statements with sqlite3_prepare_v3, after that I've inserted large amounts of data into database and run ANALYZE. Do I need to create the statements anew after that so that the query planner uses updated statistics information gathered by ANALYZE?

Upvotes: 1

Views: 195

Answers (1)

CL.
CL.

Reputation: 180060

The ANALYZE statement expires all prepared statements. When you have used sqlite3_prepare_v2() or _v3(), the sqlite3_step() function will then automatically re-prepare the statement.

Upvotes: 1

Related Questions