SQLite VDBE opcode

Trace

Write P4 on the statement trace output if statement tracing is enabled.

An example

2 of the 178 statements we compiled against the sample database use Trace. This is the one with the shortest program; the rows that use Trace are highlighted.

UPDATE tracks SET price = 1.29 WHERE id = 5
addropcodep1p2p3p4p5
0Init02500
1Null0120
2Noop3010
3OpenWrite04060
4Integer51600
5SeekRowid07160
6Rowid0200
7IsNull22400
8Rowid0300
9Null0400
10Null0500
11Null0600
12Null0700
13Null0800
14Copy2900
15Null01000
16Column01110
17Column02120
18Column03130
19Column04140
20Real1717986921510729973350
21MakeRecord1061DDBDDE0
22Insert019tracks5
23Program22417program1
24Halt0000
25Transaction01101
26Goto0100
0Init010-- TRIGGER tracks_touch0
1Trace214748364710-- UPDATE albums SET year = year WHERE id = new.album_id0
2Null0120
3Noop1010
4OpenWrite03040
5Param9700
6SeekRowid0870
7Rowid0200
8IsNull21500
9Null0300
10Column0140
11Column0250
12Column0360
13MakeRecord341DDBD0
14Insert012albums5
15ResetCount0000
16Halt0000

Open it in the EXPLAIN visualizer →

Also in this program: Column, Copy, Goto, Halt, Init, Insert, Integer, IsNull, MakeRecord, Noop, Null, OpenWrite, Param, Program, Real, ResetCount, Rowid, SeekRowid, Transaction.

What the SQLite documentation says

Write P4 on the statement trace output if statement tracing is enabled.

Operand P1 must be 0x7fffffff and P2 must positive.

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.

← TableLock · Transaction →