FilterAdd
Compute a hash on the P4 registers starting with r[P3] and add that hash to the bloom filter contained in r[P1].
An example
9 of the 178 statements we compiled against the sample database use FilterAdd. This is the one with the shortest program; the rows that use FilterAdd are highlighted.
SELECT a.name FROM artists a WHERE a.id NOT IN (SELECT artist_id FROM albums)
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 29 | 0 | 0 | |
| 1 | OpenRead | 2 | 6 | 0 | k(2,,) | 0 |
| 2 | Rewind | 2 | 28 | 1 | 0 | 0 |
| 3 | BeginSubrtn | 0 | 1 | 0 | subrtnsig:1,C | 0 |
| 4 | Once | 0 | 15 | 2 | 0 | |
| 5 | OpenEphemeral | 3 | 1 | 0 | k(1,B) | 0 |
| 6 | Blob | 10000 | 2 | 0 | 0 | |
| 7 | OpenRead | 1 | 3 | 0 | 2 | 0 |
| 8 | Rewind | 1 | 14 | 0 | 0 | |
| 9 | Column | 1 | 1 | 3 | 0 | |
| 10 | MakeRecord | 3 | 1 | 4 | C | 0 |
| 11 | IdxInsert | 3 | 4 | 3 | 1 | 0 |
| 12 | FilterAdd | 2 | 0 | 3 | 1 | 0 |
| 13 | Next | 1 | 9 | 0 | 1 | |
| 14 | NullRow | 3 | 0 | 0 | 0 | |
| 15 | Return | 1 | 4 | 1 | 0 | |
| 16 | IdxRowid | 2 | 5 | 0 | 0 | |
| 17 | Copy | 5 | 6 | 0 | 0 | |
| 18 | Affinity | 6 | 1 | 0 | C | 0 |
| 19 | Found | 3 | 24 | 6 | 1 | 0 |
| 20 | Rewind | 3 | 25 | 0 | 0 | |
| 21 | Column | 3 | 0 | 7 | 0 | |
| 22 | Ne | 6 | 25 | 7 | BINARY-8 | 0 |
| 23 | Goto | 0 | 27 | 0 | 0 | |
| 24 | Goto | 0 | 27 | 0 | 0 | |
| 25 | Column | 2 | 0 | 8 | 0 | |
| 26 | ResultRow | 8 | 1 | 0 | 0 | |
| 27 | Next | 2 | 3 | 0 | 1 | |
| 28 | Halt | 0 | 0 | 0 | 0 | |
| 29 | Transaction | 0 | 0 | 1 | 0 | 1 |
| 30 | Goto | 0 | 1 | 0 | 0 |
Open it in the EXPLAIN visualizer →
Also in this program: Affinity, BeginSubrtn, Blob, Column, Copy, Found, Goto, Halt, IdxInsert, IdxRowid, Init, MakeRecord, Ne, Next, NullRow, Once, OpenEphemeral, OpenRead, ResultRow, Return, Rewind, Transaction.
What the SQLite documentation says
Compute a hash on the P4 registers starting with r[P3] and add that hash to the bloom filter contained in r[P1].
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.
← Filter · FinishSeek →