LoadAnalysis
Read the sqlite_stat1 table for database P1 and load the content of that table into the internal index hash table.
An example
2 of the 178 statements we compiled against the sample database use LoadAnalysis. This is the one with the shortest program; the rows that use LoadAnalysis are highlighted.
ANALYZE tracks
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 77 | 0 | 0 | |
| 1 | ReadCookie | 0 | 3 | 2 | 0 | |
| 2 | If | 3 | 5 | 0 | 0 | |
| 3 | SetCookie | 0 | 2 | 4 | 0 | |
| 4 | SetCookie | 0 | 5 | 1 | 0 | |
| 5 | CreateBtree | 0 | 2 | 1 | 0 | |
| 6 | OpenWrite | 0 | 1 | 0 | 5 | 0 |
| 7 | NewRowid | 0 | 1 | 0 | 0 | |
| 8 | Blob | 6 | 3 | 0 | 0 | |
| 9 | Insert | 0 | 3 | 1 | 8 | |
| 10 | Close | 0 | 0 | 0 | 0 | |
| 11 | Close | 0 | 0 | 0 | 0 | |
| 12 | Null | 0 | 4 | 5 | 0 | |
| 13 | Noop | 4 | 0 | 4 | 0 | |
| 14 | OpenWrite | 3 | 1 | 0 | 5 | 0 |
| 15 | SeekRowid | 3 | 17 | 1 | 0 | |
| 16 | Rowid | 3 | 5 | 0 | 0 | |
| 17 | IsNull | 5 | 25 | 0 | 0 | |
| 18 | String8 | 0 | 6 | 0 | table | 0 |
| 19 | String8 | 0 | 7 | 0 | sqlite_stat1 | 0 |
| 20 | String8 | 0 | 8 | 0 | sqlite_stat1 | 0 |
| 21 | Copy | 2 | 9 | 0 | 0 | |
| 22 | String8 | 0 | 10 | 0 | CREATE TABLE sqlite_stat1(tbl,idx,stat) | 0 |
| 23 | MakeRecord | 6 | 5 | 4 | BBBDB | 0 |
| 24 | Insert | 3 | 4 | 5 | 0 | |
| 25 | SetCookie | 0 | 1 | 2 | 0 | |
| 26 | ParseSchema | 0 | 0 | 0 | tbl_name='sqlite_stat1' AND type!='trigger' | 0 |
| 27 | OpenWrite | 0 | 2 | 0 | 3 | 16 |
| 28 | OpenRead | 5 | 4 | 0 | 6 | 0 |
| 29 | String8 | 0 | 18 | 0 | tracks | 0 |
| 30 | String8 | 0 | 19 | 0 | tracks_minutes | 0 |
| 31 | OpenRead | 6 | 19 | 0 | k(2,,) | 0 |
| 32 | Integer | 0 | 17 | 0 | 0 | |
| 33 | Integer | 2 | 14 | 0 | 0 | |
| 34 | Integer | 1 | 15 | 0 | 0 | |
| 35 | Count | 6 | 16 | 0 | 0 | |
| 36 | Function | 0 | 14 | 13 | stat_init(4) | 0 |
| 37 | Rewind | 6 | 52 | 0 | 0 | |
| 38 | Integer | 0 | 14 | 0 | 0 | |
| 39 | Goto | 0 | 45 | 0 | 0 | |
| 40 | Integer | 0 | 14 | 0 | 0 | |
| 41 | Column | 6 | 0 | 16 | 0 | |
| 42 | Ne | 16 | 45 | 21 | BINARY-8 | 128 |
| 43 | Integer | 1 | 14 | 0 | 0 | |
| 44 | Goto | 0 | 46 | 0 | 0 | |
| 45 | Column | 6 | 0 | 21 | 0 | |
| 46 | Function | 1 | 13 | 16 | stat_push(2) | 0 |
| 47 | Next | 6 | 40 | 0 | 0 | |
| 48 | Function | 0 | 13 | 20 | stat_get(1) | 0 |
| 49 | MakeRecord | 18 | 3 | 16 | BBB | 0 |
| 50 | NewRowid | 0 | 12 | 0 | 0 | |
| 51 | Insert | 0 | 16 | 12 | 8 | |
| 52 | String8 | 0 | 19 | 0 | tracks_album | 0 |
| 53 | OpenRead | 6 | 5 | 0 | k(2,,) | 0 |
| 54 | Integer | 0 | 17 | 0 | 0 | |
| 55 | Integer | 2 | 14 | 0 | 0 | |
| 56 | Integer | 1 | 15 | 0 | 0 | |
| 57 | Count | 6 | 16 | 0 | 0 | |
| 58 | Function | 0 | 14 | 13 | stat_init(4) | 0 |
| 59 | Rewind | 6 | 74 | 0 | 0 | |
| 60 | Integer | 0 | 14 | 0 | 0 | |
| 61 | Goto | 0 | 67 | 0 | 0 | |
| 62 | Integer | 0 | 14 | 0 | 0 | |
| 63 | Column | 6 | 0 | 16 | 0 | |
| 64 | Ne | 16 | 67 | 21 | BINARY-8 | 128 |
| 65 | Integer | 1 | 14 | 0 | 0 | |
| 66 | Goto | 0 | 68 | 0 | 0 | |
| 67 | Column | 6 | 0 | 21 | 0 | |
| 68 | Function | 1 | 13 | 16 | stat_push(2) | 0 |
| 69 | Next | 6 | 62 | 0 | 0 | |
| 70 | Function | 0 | 13 | 20 | stat_get(1) | 0 |
| 71 | MakeRecord | 18 | 3 | 16 | BBB | 0 |
| 72 | NewRowid | 0 | 12 | 0 | 0 | |
| 73 | Insert | 0 | 16 | 12 | 8 | |
| 74 | LoadAnalysis | 0 | 0 | 0 | 0 | |
| 75 | Expire | 0 | 0 | 0 | 0 | |
| 76 | Halt | 0 | 0 | 0 | 0 | |
| 77 | Transaction | 0 | 1 | 1 | 0 | 1 |
| 78 | Goto | 0 | 1 | 0 | 0 |
Open it in the EXPLAIN visualizer →
Also in this program: Blob, Close, Column, Copy, Count, CreateBtree, Expire, Function, Goto, Halt, If, Init, Insert, Integer, IsNull, MakeRecord, Ne, NewRowid, Next, Noop, Null, OpenRead, OpenWrite, ParseSchema, ReadCookie, Rewind, Rowid, SeekRowid, SetCookie, String8, Transaction.
What the SQLite documentation says
Read the sqlite_stat1 table for database P1 and load the content of that table into the internal index hash table. This will cause the analysis to be used when preparing all subsequent queries.
From sqlite.org's list of opcodes for SQLite 3.54.1, in the public domain. Opcodes are not a stable interface and change between releases.