See the following query and query plan:
sqlite> CREATE INDEX i2 ON t1(a, b);
sqlite> EXPLAIN QUERY PLAN SELECT a, b FROM t1 WHERE a=1;
QUERY PLAN
`--SEARCH t1 USING COVERING INDEX i2 (a=?)
If I want to change the query plan (e.g., not using index), what should I do? I know not using index may be easy but there are many complex situations. The sqlite document only contain a brief introduction
SQLite provides the ability for advanced programmers to exercise control over the query plan chosen by the optimizer. One method for doing this is to fudge the ANALYZE results in the sqlite_stat1, sqlite_stat3, and/or sqlite_stat4 tables. This is not recommended for most situations.
So could you please give me some examples?
Thanks!