Last active
February 5, 2023 22:10
-
-
Save cleverca22/26c46201a9e63031add14b1b66890aba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlite> explain select * from sqlite_master; | |
addr opcode p1 p2 p3 p4 p5 comment | |
---- ------------- ---- ---- ---- ------------- -- ------------- | |
0 Init 0 12 0 0 Start at 12 | |
1 OpenRead 0 1 0 5 0 root=1 iDb=0; sqlite_master | |
2 Explain 2 0 0 SCAN sqlite_master 0 | |
3 Rewind 0 11 0 0 | |
4 Column 0 0 1 0 r[1]=sqlite_master.type | |
5 Column 0 1 2 0 r[2]=sqlite_master.name | |
6 Column 0 2 3 0 r[3]=sqlite_master.tbl_name | |
7 Column 0 3 4 0 r[4]=sqlite_master.rootpage | |
8 Column 0 4 5 0 r[5]=sqlite_master.sql | |
9 ResultRow 1 5 0 0 output=r[1..5] | |
10 Next 0 4 0 1 | |
11 Halt 0 0 0 0 | |
12 Transaction 0 0 20 0 1 usesStmtJournal=0 | |
13 Goto 0 1 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlite> explain select * from ValidPaths; | |
addr opcode p1 p2 p3 p4 p5 comment | |
---- ------------- ---- ---- ---- ------------- -- ------------- | |
0 Init 0 16 0 0 Start at 16 | |
1 OpenRead 0 2 0 9 0 root=2 iDb=0; ValidPaths | |
2 Explain 2 0 0 SCAN ValidPaths 0 | |
3 Rewind 0 15 0 0 | |
4 Rowid 0 1 0 0 r[1]=ValidPaths.rowid | |
5 Column 0 1 2 0 r[2]=ValidPaths.path | |
6 Column 0 2 3 0 r[3]=ValidPaths.hash | |
7 Column 0 3 4 0 r[4]=ValidPaths.registrationTime | |
8 Column 0 4 5 0 r[5]=ValidPaths.deriver | |
9 Column 0 5 6 0 r[6]=ValidPaths.narSize | |
10 Column 0 6 7 0 r[7]=ValidPaths.ultimate | |
11 Column 0 7 8 0 r[8]=ValidPaths.sigs | |
12 Column 0 8 9 0 r[9]=ValidPaths.ca | |
13 ResultRow 1 9 0 0 output=r[1..9] | |
14 Next 0 4 0 1 | |
15 Halt 0 0 0 0 | |
16 Transaction 0 0 20 0 1 usesStmtJournal=0 | |
17 Goto 0 1 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlite> explain select rowid * 5 from ValidPaths; | |
addr opcode p1 p2 p3 p4 p5 comment | |
---- ------------- ---- ---- ---- ------------- -- ------------- | |
0 Init 0 9 0 0 Start at 9 | |
1 OpenRead 1 3 0 k(1,) 0 root=3 iDb=0; sqlite_autoindex_ValidPaths_1 | |
2 Explain 2 0 0 SCAN ValidPaths USING COVERING INDEX sqlite_autoindex_ValidPaths_1 0 | |
3 Rewind 1 8 1 0 0 | |
4 IdxRowid 1 2 0 0 r[2]=rowid; ValidPaths.rowid | |
5 Multiply 3 2 1 0 r[1]=r[3]*r[2] | |
6 ResultRow 1 1 0 0 output=r[1] | |
7 Next 1 4 0 1 | |
8 Halt 0 0 0 0 | |
9 Transaction 0 0 20 0 1 usesStmtJournal=0 | |
10 Integer 5 3 0 0 r[3]=5 | |
11 Goto 0 1 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlite> explain select * from ValidPaths inner join DerivationOutputs on ValidPaths.deriver = DerivationOutputs.drv; | |
addr opcode p1 p2 p3 p4 p5 comment | |
---- ------------- ---- ---- ---- ------------- -- ------------- | |
0 Init 0 29 0 0 Start at 29 | |
1 OpenRead 0 2 0 9 0 root=2 iDb=0; ValidPaths | |
2 OpenRead 1 7 0 3 0 root=7 iDb=0; DerivationOutputs | |
3 OpenRead 2 8 0 k(2,,) 2 root=8 iDb=0; sqlite_autoindex_DerivationOutputs_1 | |
4 Explain 4 0 0 SCAN ValidPaths 0 | |
5 Rewind 0 28 0 0 | |
6 Explain 6 0 0 SEARCH DerivationOutputs USING INDEX sqlite_autoindex_DerivationOutputs_1 (drv=?) 0 | |
7 Column 0 4 1 0 r[1]=ValidPaths.deriver | |
8 IsNull 1 27 0 0 if r[1]==NULL goto 27 | |
9 Affinity 1 1 0 C 0 affinity(r[1]) | |
10 SeekGE 2 27 1 1 0 key=r[1] | |
11 IdxGT 2 27 1 1 0 key=r[1] | |
12 DeferredSeek 2 0 1 0 Move 1 to 2.rowid if needed | |
13 Rowid 0 2 0 0 r[2]=ValidPaths.rowid | |
14 Column 0 1 3 0 r[3]=ValidPaths.path | |
15 Column 0 2 4 0 r[4]=ValidPaths.hash | |
16 Column 0 3 5 0 r[5]=ValidPaths.registrationTime | |
17 Column 0 4 6 0 r[6]=ValidPaths.deriver | |
18 Column 0 5 7 0 r[7]=ValidPaths.narSize | |
19 Column 0 6 8 0 r[8]=ValidPaths.ultimate | |
20 Column 0 7 9 0 r[9]=ValidPaths.sigs | |
21 Column 0 8 10 0 r[10]=ValidPaths.ca | |
22 Column 2 0 11 0 r[11]=DerivationOutputs.drv | |
23 Column 2 1 12 0 r[12]=DerivationOutputs.id | |
24 Column 1 2 13 0 r[13]=DerivationOutputs.path | |
25 ResultRow 2 12 0 0 output=r[2..13] | |
26 Next 2 11 0 0 | |
27 Next 0 6 0 1 | |
28 Halt 0 0 0 0 | |
29 Transaction 0 0 20 0 1 usesStmtJournal=0 | |
30 Goto 0 1 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlite> explain select * from validpaths limit 5; | |
addr opcode p1 p2 p3 p4 p5 comment | |
---- ------------- ---- ---- ---- ------------- -- ------------- | |
0 Init 0 18 0 0 Start at 18 | |
1 Integer 5 1 0 0 r[1]=5; LIMIT counter | |
2 OpenRead 0 2 0 9 0 root=2 iDb=0; ValidPaths | |
3 Explain 3 0 0 SCAN validpaths 0 | |
4 Rewind 0 17 0 0 | |
5 Rowid 0 2 0 0 r[2]=ValidPaths.rowid | |
6 Column 0 1 3 0 r[3]=ValidPaths.path | |
7 Column 0 2 4 0 r[4]=ValidPaths.hash | |
8 Column 0 3 5 0 r[5]=ValidPaths.registrationTime | |
9 Column 0 4 6 0 r[6]=ValidPaths.deriver | |
10 Column 0 5 7 0 r[7]=ValidPaths.narSize | |
11 Column 0 6 8 0 r[8]=ValidPaths.ultimate | |
12 Column 0 7 9 0 r[9]=ValidPaths.sigs | |
13 Column 0 8 10 0 r[10]=ValidPaths.ca | |
14 ResultRow 2 9 0 0 output=r[2..10] | |
15 DecrJumpZero 1 17 0 0 if (--r[1])==0 goto 17 | |
16 Next 0 5 0 1 | |
17 Halt 0 0 0 0 | |
18 Transaction 0 0 20 0 1 usesStmtJournal=0 | |
19 Goto 0 1 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlite> explain select * from validpaths limit 10, 5; | |
addr opcode p1 p2 p3 p4 p5 comment | |
---- ------------- ---- ---- ---- ------------- -- ------------- | |
0 Init 0 22 0 0 Start at 22 | |
1 Integer 5 1 0 0 r[1]=5; LIMIT counter | |
2 Integer 10 2 0 0 r[2]=10 | |
3 MustBeInt 2 0 0 0 OFFSET counter | |
4 OffsetLimit 1 3 2 0 if r[1]>0 then r[3]=r[1]+max(0,r[2]) else r[3]=(-1); LIMIT+OFFSET | |
5 OpenRead 0 2 0 9 0 root=2 iDb=0; ValidPaths | |
6 Explain 6 0 0 SCAN validpaths 0 | |
7 Rewind 0 21 0 0 | |
8 IfPos 2 20 1 0 if r[2]>0 then r[2]-=1, goto 20; OFFSET | |
9 Rowid 0 4 0 0 r[4]=ValidPaths.rowid | |
10 Column 0 1 5 0 r[5]=ValidPaths.path | |
11 Column 0 2 6 0 r[6]=ValidPaths.hash | |
12 Column 0 3 7 0 r[7]=ValidPaths.registrationTime | |
13 Column 0 4 8 0 r[8]=ValidPaths.deriver | |
14 Column 0 5 9 0 r[9]=ValidPaths.narSize | |
15 Column 0 6 10 0 r[10]=ValidPaths.ultimate | |
16 Column 0 7 11 0 r[11]=ValidPaths.sigs | |
17 Column 0 8 12 0 r[12]=ValidPaths.ca | |
18 ResultRow 4 9 0 0 output=r[4..12] | |
19 DecrJumpZero 1 21 0 0 if (--r[1])==0 goto 21 | |
20 Next 0 8 0 1 | |
21 Halt 0 0 0 0 | |
22 Transaction 0 0 20 0 1 usesStmtJournal=0 | |
23 Goto 0 1 0 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment