OpenAutoindex
This opcode works the same as OpenEphemeral.
An example
5 of the 178 statements we compiled against the sample database use OpenAutoindex. This is the one with the shortest program; the rows that use OpenAutoindex 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, Explain, Filter, FilterAdd, Goto, Halt, IdxGT, IdxInsert, IdxRowid, IfPos, Init, Integer, MakeRecord, Next, NullRow, Once, OpenRead, ResultRow, Rewind, Rowid, SeekGE, Transaction.
What the SQLite documentation says
This opcode works the same as OpenEphemeral. It has a different name to distinguish its use. Tables created using by this opcode will be used for automatically created transient indices in joins.
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.