SQLite Forum

Query planner stability guarantee with SQLITE_ENABLE_STAT4
Login
Neither.  The query plan is not stable in the face of ANALYZE.

In order for the QPSG to hold you must not run additional ANALYZE.  That is, the following must remain invariant:

 - the database schema

 - ANALYZE must not be re-run

In addition, if SQLITE_ENABLE_STAT4 has been used then one must also hold the query parameters which may affect the plan invariant.