Explain
This is the same as Noop during normal query execution.
An example
5 of the 178 statements we compiled against the sample database use Explain. This is the one with the shortest program; the rows that use Explain are highlighted.
SELECT a.name, b.title FROM artists a LEFT JOIN albums b ON b.artist_id = a.id
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 31 | 0 | 0 | |
| 1 | OpenRead | 2 | 6 | 0 | k(2,,) | 0 |
| 2 | OpenRead | 1 | 3 | 0 | 4 | 0 |
| 3 | Rewind | 2 | 30 | 1 | 0 | 0 |
| 4 | Once | 0 | 16 | 0 | 0 | |
| 5 | OpenAutoindex | 3 | 3 | 0 | k(3,B,,) | 0 |
| 6 | Explain | 6 | 0 | 0 | BLOOM FILTER ON b (artist_id=?) | 0 |
| 7 | Blob | 10000 | 1 | 0 | 0 | |
| 8 | Rewind | 1 | 16 | 0 | 0 | |
| 9 | Column | 1 | 1 | 3 | 0 | |
| 10 | Column | 1 | 2 | 4 | 0 | |
| 11 | Rowid | 1 | 5 | 0 | 0 | |
| 12 | MakeRecord | 3 | 3 | 2 | 0 | |
| 13 | FilterAdd | 1 | 0 | 3 | 1 | 0 |
| 14 | IdxInsert | 3 | 2 | 0 | 16 | |
| 15 | Next | 1 | 9 | 0 | 3 | |
| 16 | Integer | 0 | 6 | 0 | 0 | |
| 17 | IdxRowid | 2 | 7 | 0 | 0 | |
| 18 | Filter | 1 | 26 | 7 | 1 | 0 |
| 19 | SeekGE | 3 | 26 | 7 | 1 | 0 |
| 20 | IdxGT | 3 | 26 | 7 | 1 | 0 |
| 21 | Integer | 1 | 6 | 0 | 0 | |
| 22 | Column | 2 | 0 | 8 | 0 | |
| 23 | Column | 3 | 1 | 9 | 0 | |
| 24 | ResultRow | 8 | 2 | 0 | 0 | |
| 25 | Next | 3 | 20 | 0 | 0 | |
| 26 | IfPos | 6 | 29 | 0 | 0 | |
| 27 | NullRow | 3 | 0 | 0 | 0 | |
| 28 | Goto | 0 | 21 | 0 | 0 | |
| 29 | Next | 2 | 4 | 0 | 1 | |
| 30 | Halt | 0 | 0 | 0 | 0 | |
| 31 | Transaction | 0 | 0 | 1 | 0 | 1 |
| 32 | Goto | 0 | 1 | 0 | 0 |
Open it in the EXPLAIN visualizer →
Also in this program: Blob, Column, Filter, FilterAdd, Goto, Halt, IdxGT, IdxInsert, IdxRowid, IfPos, Init, Integer, MakeRecord, Next, NullRow, Once, OpenAutoindex, OpenRead, ResultRow, Rewind, Rowid, SeekGE, Transaction.
What the SQLite documentation says
This is the same as Noop during normal query execution. The purpose of this opcode is to hold information about the query plan for the purpose of EXPLAIN QUERY PLAN output.
The P4 value is human-readable text that describes the query plan element. Something like "SCAN t1" or "SEARCH t2 USING INDEX t2x1".
The P1 value is the ID of the current element and P2 is the parent element for the case of nested query plan elements. If P2 is zero then this element is a top-level element.
For loop elements, P3 is the estimated code of each invocation of this element.
As with all opcodes, the meanings of the parameters for Explain are subject to change from one release to the next. Applications should not attempt to interpret or use any of the information contained in the Explain opcode. The information provided by this opcode is intended for testing and debugging use only.
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.