On Tue, Apr 7, 2015 at 1:42 PM, Paul Caskey <paul.caskey at gmail.com> wrote:
> Any idea why there is such a performance hit when I ask for both min() and
> max() at the same time? Shouldn't it be just as fast as querying them
> individually?

This has come up before.  Either alone can be satisfied from an index
lookup, which seems likely in this case given your count(*) results,
but both together aren't optimized.
http://www.sqlite.org/optoverview.html#minmax

You could do SELECT (SELECT min(dtime) FROM intstats), (SELECT
max(dtime) FROM intstats).  Or go poking through the archives for
other past examples.

-scott

Reply via email to