SQLite VDBE opcode

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)
addropcodep1p2p3p4p5
0Init02900
1OpenRead260k(2,,)0
2Rewind228100
3BeginSubrtn010subrtnsig:1,C0
4Once01520
5OpenEphemeral310k(1,B)0
6Blob10000200
7OpenRead13020
8Rewind11400
9Column1130
10MakeRecord314C0
11IdxInsert34310
12FilterAdd20310
13Next1901
14NullRow3000
15Return1410
16IdxRowid2500
17Copy5600
18Affinity610C0
19Found324610
20Rewind32500
21Column3070
22Ne6257BINARY-80
23Goto02700
24Goto02700
25Column2080
26ResultRow8100
27Next2301
28Halt0000
29Transaction00101
30Goto0100

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 →