title: how to judge sql performance through these 2 explain?
body: <p>If I give you 2 explain results from MySQL,how do you know which query is better? </p>
  
  <p>the first sql explain</p>
  
  <pre><code>*************************** 1. row ***************************
             id: 1
    select_type: SIMPLE
          table: sbtest2
           type: index
  possible_keys: NULL
            key: PRIMARY
        key_len: 4
            ref: NULL
           rows: 700100
          Extra: 
  1 row in set (0.00 sec)
  </code></pre>
  
  <p>and the second sql explain </p>
  
  <pre><code>*************************** 1. row ***************************
             id: 1
    select_type: PRIMARY
          table: &lt;derived2&gt;
           type: ALL
  possible_keys: NULL
            key: NULL
        key_len: NULL
            ref: NULL
           rows: 100
          Extra: 
  *************************** 2. row ***************************
             id: 1
    select_type: PRIMARY
          table: a
           type: eq_ref
  possible_keys: PRIMARY
            key: PRIMARY
        key_len: 4
            ref: b.id
           rows: 1
          Extra: 
  *************************** 3. row ***************************
             id: 2
    select_type: DERIVED
          table: sbtest2
           type: index
  possible_keys: NULL
            key: PRIMARY
        key_len: 4
            ref: NULL
           rows: 700100
          Extra: Using index
  3 rows in set (1.46 sec)
  </code></pre>
  
  <p>I think I will choose the first query because there are "a lot of" things to do in the second explain,but actually the second query is much faster than the first query , so my question is if I don't see the response time,how to judge their performance through explain ?</p>
  
  <p>the first query's Duration: 4.43704325</p>
  
  <pre><code>select * from sbtest.sbtest2 
  order by id 
  limit 700000,100;
  </code></pre>
  
  <p>after restart MySQL server to clean cache ,the second query's uration: 2.08889400 (faster) </p>
  
  <pre><code>select * from sbtest.sbtest2 a
  inner join 
  (select id from sbtest.sbtest2  order by id limit 700000,100 ) as b
  on a.id=b.id;
  </code></pre>
  
  <p>can anybody help me ?</p>