SeekEnd
Position cursor P1 at the end of the btree for the purpose of appending a new entry onto the btree.
An example
3 of the 178 statements we compiled against the sample database use SeekEnd. This is the one with the shortest program; the rows that use SeekEnd are highlighted.
REINDEX tracks_album
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 20 | 0 | 0 | |
| 1 | SorterOpen | 2 | 0 | 1 | k(2,,) | 0 |
| 2 | OpenRead | 0 | 4 | 0 | 6 | 0 |
| 3 | Rewind | 0 | 9 | 0 | 0 | |
| 4 | Column | 0 | 1 | 2 | 0 | |
| 5 | Rowid | 0 | 3 | 0 | 0 | |
| 6 | MakeRecord | 2 | 2 | 1 | 0 | |
| 7 | SorterInsert | 2 | 1 | 0 | 0 | |
| 8 | Next | 0 | 4 | 0 | 0 | |
| 9 | Clear | 5 | 0 | 0 | 0 | |
| 10 | OpenWrite | 1 | 5 | 0 | k(2,,) | 1 |
| 11 | SorterSort | 2 | 16 | 0 | 0 | |
| 12 | SorterData | 2 | 1 | 1 | 0 | |
| 13 | SeekEnd | 1 | 0 | 0 | 0 | |
| 14 | IdxInsert | 1 | 1 | 0 | 16 | |
| 15 | SorterNext | 2 | 12 | 0 | 0 | |
| 16 | Close | 0 | 0 | 0 | 0 | |
| 17 | Close | 1 | 0 | 0 | 0 | |
| 18 | Close | 2 | 0 | 0 | 0 | |
| 19 | Halt | 0 | 0 | 0 | 0 | |
| 20 | Transaction | 0 | 1 | 1 | 0 | 1 |
| 21 | Goto | 0 | 1 | 0 | 0 |
Open it in the EXPLAIN visualizer →
Also in this program: Clear, Close, Column, Goto, Halt, IdxInsert, Init, MakeRecord, Next, OpenRead, OpenWrite, Rewind, Rowid, SorterData, SorterInsert, SorterNext, SorterOpen, SorterSort, Transaction.
What the SQLite documentation says
Position cursor P1 at the end of the btree for the purpose of appending a new entry onto the btree.
It is assumed that the cursor is used only for appending and so if the cursor is valid, then the cursor must already be pointing at the end of the btree and so no changes are made to the cursor.
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.