SQLite VDBE opcode

LoadAnalysis

Read the sqlite_stat1 table for database P1 and load the content of that table into the internal index hash table.

An example

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

ANALYZE tracks
addropcodep1p2p3p4p5
0Init07700
1ReadCookie0320
2If3500
3SetCookie0240
4SetCookie0510
5CreateBtree0210
6OpenWrite01050
7NewRowid0100
8Blob6300
9Insert0318
10Close0000
11Close0000
12Null0450
13Noop4040
14OpenWrite31050
15SeekRowid31710
16Rowid3500
17IsNull52500
18String8060table0
19String8070sqlite_stat10
20String8080sqlite_stat10
21Copy2900
22String80100CREATE TABLE sqlite_stat1(tbl,idx,stat)0
23MakeRecord654BBBDB0
24Insert3450
25SetCookie0120
26ParseSchema000tbl_name='sqlite_stat1' AND type!='trigger'0
27OpenWrite020316
28OpenRead54060
29String80180tracks0
30String80190tracks_minutes0
31OpenRead6190k(2,,)0
32Integer01700
33Integer21400
34Integer11500
35Count61600
36Function01413stat_init(4)0
37Rewind65200
38Integer01400
39Goto04500
40Integer01400
41Column60160
42Ne164521BINARY-8128
43Integer11400
44Goto04600
45Column60210
46Function11316stat_push(2)0
47Next64000
48Function01320stat_get(1)0
49MakeRecord18316BBB0
50NewRowid01200
51Insert016128
52String80190tracks_album0
53OpenRead650k(2,,)0
54Integer01700
55Integer21400
56Integer11500
57Count61600
58Function01413stat_init(4)0
59Rewind67400
60Integer01400
61Goto06700
62Integer01400
63Column60160
64Ne166721BINARY-8128
65Integer11400
66Goto06800
67Column60210
68Function11316stat_push(2)0
69Next66200
70Function01320stat_get(1)0
71MakeRecord18316BBB0
72NewRowid01200
73Insert016128
74LoadAnalysis0000
75Expire0000
76Halt0000
77Transaction01101
78Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Blob, Close, Column, Copy, Count, CreateBtree, Expire, Function, Goto, Halt, If, Init, Insert, Integer, IsNull, MakeRecord, Ne, NewRowid, Next, Noop, Null, OpenRead, OpenWrite, ParseSchema, ReadCookie, Rewind, Rowid, SeekRowid, SetCookie, String8, Transaction.

What the SQLite documentation says

Read the sqlite_stat1 table for database P1 and load the content of that table into the internal index hash table. This will cause the analysis to be used when preparing all subsequent queries.

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.

← Le · Lt →