> > > > 1) SQLITE has to read about _half of index_ before it can use it (and > > understand there are no records matching query). > > > > If cache is enough to hold 50 Mb then on subsuquent queries sqlite process > > is not reading at all. > > > > Please, post your query. To understand whether sqlite reads too much > or not it's better to know what exactly you want to select. >
This is script I ran: CREATE TABLE IF NOT EXISTS T(t); DELETE FROM T; INSERT INTO T VALUES( strftime('%s', 'now' ) ); EXPLAIN QUERY PLAN SELECT * FROM log INDEXED BY idxlog_kind_computer WHERE kind = 'info' AND computer=1 and id > 7070636 LIMIT 100; SELECT * FROM log INDEXED BY idxlog_kind_computer WHERE kind = 'info' AND computer=1 and id > 7070636 LIMIT 100; SELECT "Seconds elapsed: " || (strftime('%s', 'now' ) - t) FROM T ; > > > 2) SQLITE is reading abnormally slowly during this first-time running query > > (waiting for something a lot?). > > > > Is this with the recreated index or still the one that was created > during the lifetime of your program? > It doesn't matter. Tried it with old and with recreated index, same behaviour. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users