On 18 Sep 2017, at 1:59pm, J Decker <d3c...@gmail.com> wrote:
> What if the select had an ORDER BY ? wouldn't it have to pull the full set > of rows ? No. Suppose you declare an index on the same sort order. Then SQLite could just read the rows starting from the top of the index. CREATE TABLE directory (firstname TEXT COLLATE NOCASE, secondname TEXT COLLATE NOCASE, phone TEXT); CREATE INDEX d_sf ON directory (secondname, firstname); SELECT * FROM directory WHERE secondname >= 'd' AND secondname < 'g' ORDER BY secondname; SQLite is extremely clever at trying to find a way to satisfy your query without having to scan the whole table or make up its own index. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users