On 22 Jul 2011, at 2:11pm, Григорий Григоренко wrote: > Let's say it'll shrink by 50%. Still, if first-time runnning query timing > will change from 2 min to 1 min it is still not acceptable. > I cannot wait even a minute without logging. > > So, before restructuring database and re-writing code I just want to > understand SQLITE behaviour. > The question is: does SQLITE need to load whole index to start using it? Or > SQLITE can use partial loads to quickly find records it needs (defined by > columns in conditions)?
SQLite loads only the pages it needs. It doesn't load a whole index into memory unless the entire index fits in one page (only a few rows). If your search still runs too slowly your problem is more likely to be that you are searching on text fields rather than integer fields. Searching on integers is /must/ faster than searching on test fields. If you store the id code of the computer in your log file rather than the text name of the computer, a search for log entries for a particular computer will be faster. I don't know what you're doing with your 'kind' column, but again if you assign integer values to your different values for 'kind' and store those instead, your search will be faster. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users