On 1 Sep 2015, at 7:40am, Isaac Goldberg <igoldbergvt at gmail.com> wrote:

> I'm seeing that EXPLAIN QUERY PLAN returns SEARCH instead of SCAN when
> using min() or max(). For example:
> 
> sqlite> create table t(a int, b int);
>> sqlite> explain query plan select min(b) from t;
>> 0|0|0|SEARCH TABLE t
> 
> Why is this a SEARCH instead of a SCAN? Furthermore, is it expected that
> sometimes SEARCH can be returned with no specified index like this?

Because there's no convenient index.  Try

CREATE TABLE t(a INT, b INT);
CREATE INDEX t_b ON t(b);
EXPLAIN QUERY PLAN SELECT min(b) FROM t;

Simon.

Reply via email to