IdxLT
The P4 register values beginning with P3 form an unpacked index key that omits the PRIMARY KEY or ROWID.
Jumps: P2 is an instruction address. In the listings here, a jump is drawn as an arc and the address is a link.
An example
1 of the 178 statements we compiled against the sample database use IdxLT. This is the one with the shortest program; the rows that use IdxLT are highlighted.
SELECT * FROM artists WHERE name >= 'B' ORDER BY name DESC
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 14 | 0 | 0 | |
| 1 | Noop | 1 | 5 | 0 | 0 | |
| 2 | OpenRead | 0 | 2 | 0 | 3 | 0 |
| 3 | OpenRead | 2 | 6 | 0 | k(2,,) | 0 |
| 4 | Last | 2 | 13 | 1 | 0 | 0 |
| 5 | String8 | 0 | 1 | 0 | B | 0 |
| 6 | IdxLT | 2 | 13 | 1 | 1 | 0 |
| 7 | DeferredSeek | 2 | 0 | 0 | 0 | |
| 8 | IdxRowid | 2 | 2 | 0 | 0 | |
| 9 | Column | 2 | 0 | 3 | 0 | |
| 10 | Column | 0 | 2 | 4 | 0 | |
| 11 | ResultRow | 2 | 3 | 0 | 0 | |
| 12 | Prev | 2 | 6 | 0 | 0 | |
| 13 | Halt | 0 | 0 | 0 | 0 | |
| 14 | Transaction | 0 | 0 | 1 | 0 | 1 |
| 15 | Goto | 0 | 1 | 0 | 0 |
Open it in the EXPLAIN visualizer →
Also in this program: Column, DeferredSeek, Goto, Halt, IdxRowid, Init, Last, Noop, OpenRead, Prev, ResultRow, String8, Transaction.
What the SQLite documentation says
The P4 register values beginning with P3 form an unpacked index key that omits the PRIMARY KEY or ROWID. Compare this key value against the index that P1 is currently pointing to, ignoring the PRIMARY KEY or ROWID on the P1 index.
If the P1 index entry is less than the key value then jump to P2. Otherwise fall through to the next instruction.
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.