(1) テーブル作成
create table testtable(
id integer not null default 0,
xname text not null default '',
constraint pk_testtable primary key (id)
)
(2) データ2件投入
insert into testtable(id, xname) values(1001, 'hello')
insert into testtable(id, xname) values(1002, 'world')
(3) SQL 生成 & 実行
select id, xname from testtable where id in (1,2,...,N)
生成した SQL を sqlite3_exec で実行させて戻ってくるまでの時間
N=10000 285.892ms
N=100000 3960.603ms
N=1000000 43520.460ms
sqlite3 version 3.8.3.1
OS=Windows7 pro
CPU=Ivy Bridge 3770無印