> Because the index is smaller than the main table. Less disk I/O. Yes and that is the one (and only one) interesting thing I found from this thread. So you could benefit from an index for reasons other than the usual reasons eg assisting the where clause.
RBS On Thu, Jan 12, 2017 at 4:33 PM, Richard Hipp <[email protected]> wrote: > On 1/12/17, Luca Ferrari <[email protected]> wrote: > > > One thing I was not expecting was SQLite to use the index at all: > > since the query does not apply any filter (where clause), it simply > > states that the user wants all the rows, and while it is true that the > > order is something the engine can choose, why bother traversing an > > index instead of a direct scan of the table? > > Because the index is smaller than the main table. Less disk I/O. > > -- > D. Richard Hipp > [email protected] > _______________________________________________ > sqlite-users mailing list > [email protected] > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

