我一直试图让 sqlite 使用一个喜欢的索引,但无济于事。我试过整理 nocase,但仍然没有运气。任何人都对如何让 sqlite 像点击索引有任何想法。提前致谢
DROP TABLE IF EXISTS "test";
DROP TABLE IF EXISTS "test2";
DROP TABLE IF EXISTS "test3";
create table test(name TEXT COLLATE NOCASE);
create table test2(name TEXT);
create table test3(name TEXT);
create index idx_test_name on test(name);
create index idx_test2_name on test2(name);
create index idx_test3_name on test3(name COLLATE NOCASE);
insert into test(name) values('dan');
insert into test2(name) values('dan');
insert into test3(name) values('dan');
--explain query plan select * from test where name like 'test%'
-- explain query plan select * from test2 where name like 'test%'
-- explain query plan select * from test3 where name like 'test%'