Closed benclmnt closed 1 month ago
sqlite> explain select * from products where id = 1; addr opcode p1 p2 p3 p4 p5 comment ---- ------------- ---- ---- ---- ------------- -- ------------- 0 Init 0 10 0 0 Start at 10 1 OpenRead 0 3 0 3 0 root=3 iDb=0; products 2 Integer 1 1 0 0 r[1]=1 3 SeekRowid 0 9 1 0 intkey=r[1] 4 Rowid 0 2 0 0 r[2]=products.rowid 5 Column 0 1 3 0 r[3]= cursor 0 column 1 6 Column 0 2 4 0 r[4]= cursor 0 column 2 7 RealAffinity 4 0 0 0 8 ResultRow 2 3 0 0 output=r[2..4] 9 Halt 0 0 0 0 10 Transaction 0 0 2 0 1 usesStmtJournal=0 11 Goto 0 1 0 0
I was checking sqlite3 and it doesn't generate a String8 opcode. What am I missing?
forget this comment, query was not correct.
I was checking sqlite3 and it doesn't generate a String8 opcode. What am I missing?
That sql query makes use of a covering index. Oops i might have forgot to change the query 😅 - edited now
Move where clause literal out of loop. Related #122
Previous:
Now: Move line 6 to line 16
sqlite3: