title: sqlite3 select min, max together is much slower than select them separately
body: <pre><code>sqlite&gt; explain query plan select max(utc_time) from RequestLog;
  0|0|0|SEARCH TABLE RequestLog USING COVERING INDEX key (~1 rows) # very fast
  
  sqlite&gt; explain query plan select min(utc_time) from RequestLog;
  0|0|0|SEARCH TABLE RequestLog USING COVERING INDEX key (~1 rows) # very fast
  
  sqlite&gt; explain query plan select min(utc_time), max(utc_time) from RequestLog;
  0|0|0|SCAN TABLE RequestLog (~8768261 rows) # will be very very slow
  </code></pre>
  <p>While I use <code>min</code> and <code>max</code> separately, it works perfectly. However, sqlite will 'forget' the index while I select the <code>min</code> and <code>max</code> together for some reason. Is there any configuration I can do (I used <code>Analyze</code> already, it won't work)? or is there any explanation for this behavior?</p>
  <h1>EDIT1</h1>
  <pre><code>sqlite&gt; .schema 
  
  CREATE TABLE FixLog(
                      app_id text,  __key__id INTEGER,
                      secret text, trace_code text, url text,
                      action text,facebook_id text,ip text,
                      tw_time datetime,time datetime,
                      tag text,to_url text,
                      from_url text,referer text,weight integer,
                      Unique(app_id, __key__id)
                      );
  CREATE INDEX key4 on FixLog(action);
  CREATE INDEX time on FixLog(time desc);
  CREATE INDEX tw_time on FixLog(tw_time desc);
  
  
  
  sqlite&gt; explain query select min(time) from FixLog;
  0|0|0|SEARCH TABLE FixLog USING COVERING INDEX time (~1 rows)
  sqlite&gt; explain query select max(time) from FixLog;
  0|0|0|SEARCH TABLE FixLog USING COVERING INDEX time (~1 rows)
  sqlite&gt; explain query plan select max(time), min(time) from FixLog;
  0|0|0|SCAN TABLE FixLog (~1000000 rows)
  </code></pre>