I cannot definitely solve your problem but I can think of some things to try.  
First, do these:

ANALYZE;
CREATE INDEX map_dsn ON map (d, s, n);
CREATE INDEX map_dns ON map (d, n, s);

then execute the same SELECT.  Does it have the same problem ?  Does the 
EXPLAIN QUERY PLAN tell you which of the (now) three indexes SQLite has chosen.

Shouldn't ANALZYE be run _after_ creating the indexes?

sqlite> create table t(x int, y int);
sqlite> insert into t values (1,1), (2,1), (3,3);
sqlite> analyze t;
sqlite> select * from sqlite_stat1;
t||3
sqlite> create index i on t(x,y);
sqlite> select * from sqlite_stat1;
t||3
sqlite> analyze t;
sqlite> select * from sqlite_stat1;
t|i|3 1 1

Fabian
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to