Thanks,
Here is explain results for the query with single matcher
explain query plan select * from foo where id=1
[{"id":2,"parent":0,"notused":0,"detail":"SEARCH foo USING INTEGER PRIMARY KEY (rowid=?)"}]
explain select * from foo where id=1
[{"addr":0,"opcode":"Init","p1":0,"p2":7,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":1,"opcode":"OpenRead","p1":0,"p2":4,"p3":0,"p4":"0","p5":0,"comment":null},
{"addr":2,"opcode":"Integer","p1":1,"p2":1,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":3,"opcode":"SeekRowid","p1":0,"p2":6,"p3":1,"p4":null,"p5":0,"comment":null},
{"addr":4,"opcode":"Rowid","p1":0,"p2":2,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":5,"opcode":"ResultRow","p1":2,"p2":1,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":6,"opcode":"Halt","p1":0,"p2":0,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":7,"opcode":"Transaction","p1":0,"p2":0,"p3":26,"p4":"0","p5":1,"comment":null},
{"addr":8,"opcode":"Goto","p1":0,"p2":1,"p3":0,"p4":null,"p5":0,"comment":null}]
and this is the results for the query with in clause
explain query plan select * from foo where id in (1,2)
[{"id":2,"parent":0,"notused":0,"detail":"SEARCH foo USING INTEGER PRIMARY KEY (rowid=?)"}]
explain select * from foo where id in (1,2)
[{"addr":0,"opcode":"Init","p1":0,"p2":21,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":1,"opcode":"OpenRead","p1":0,"p2":4,"p3":0,"p4":"0","p5":0,"comment":null},
{"addr":2,"opcode":"BeginSubrtn","p1":0,"p2":2,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":3,"opcode":"Once","p1":0,"p2":12,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":4,"opcode":"OpenEphemeral","p1":1,"p2":1,"p3":0,"p4":"k(1,)","p5":0,"comment":null},
{"addr":5,"opcode":"Integer","p1":1,"p2":3,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":6,"opcode":"MakeRecord","p1":3,"p2":1,"p3":4,"p4":"D","p5":0,"comment":null},
{"addr":7,"opcode":"IdxInsert","p1":1,"p2":4,"p3":3,"p4":"1","p5":0,"comment":null},
{"addr":8,"opcode":"Integer","p1":2,"p2":3,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":9,"opcode":"MakeRecord","p1":3,"p2":1,"p3":4,"p4":"D","p5":0,"comment":null},
{"addr":10,"opcode":"IdxInsert","p1":1,"p2":4,"p3":3,"p4":"1","p5":0,"comment":null},
{"addr":11,"opcode":"NullRow","p1":1,"p2":0,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":12,"opcode":"Return","p1":2,"p2":3,"p3":1,"p4":null,"p5":0,"comment":null},
{"addr":13,"opcode":"Rewind","p1":1,"p2":20,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":14,"opcode":"Column","p1":1,"p2":0,"p3":1,"p4":null,"p5":0,"comment":null},
{"addr":15,"opcode":"IsNull","p1":1,"p2":19,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":16,"opcode":"SeekRowid","p1":0,"p2":19,"p3":1,"p4":null,"p5":0,"comment":null},
{"addr":17,"opcode":"Rowid","p1":0,"p2":5,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":18,"opcode":"ResultRow","p1":5,"p2":1,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":19,"opcode":"Next","p1":1,"p2":14,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":20,"opcode":"Halt","p1":0,"p2":0,"p3":0,"p4":null,"p5":0,"comment":null},
{"addr":21,"opcode":"Transaction","p1":0,"p2":0,"p3":26,"p4":"0","p5":1,"comment":null},
{"addr":22,"opcode":"Goto","p1":0,"p2":1,"p3":0,"p4":null,"p5":0,"comment":null}]
I examined explain select ...
since there are no difference for explain query plan select ...
.
but I don’t familiar with the internal of SQLite.
Can it be read whether the virtual table is created by this log?