Before you can speed up a query you have to know how SQLite will run it. EXPLAIN QUERY PLAN shows the strategy chosen by the planner without running the query.
The orders table (5,000 rows) has no index on total. Prefix this query with EXPLAIN QUERY PLAN and run it:
SELECT * FROM orders WHERE total > 90;
The result should show a full table scan.
EXPLAIN QUERY PLAN on exactly SELECT * FROM orders WHERE total > 90SCAN of ordersThe statement is EXPLAIN QUERY PLAN followed by the query.
Read the detail column: SCAN orders means every row is read.
No results yet
Run your code to check it against the examples, or submit to run every test.