title: Avoid full table scan in mysql while using order by with limit
body: <p>I m writing a query:</p>
  
  <pre><code>select * from table_name order by id limit 21
  </code></pre>
  
  <p>Until i use the limit is lesser or equal to 20 the rows getting scanned is equal to the exact fetching rows (for example if the limit is 10, than the scanned rows also 10 only). If the limit exceeds 20 the table getting scanned fully.</p>
  
  <p>The only one index created for the primary key id only. Can anybody tell the reason for the full table scan in this case?</p>
  
  <hr>
  
  <p>My table has 1099 rows.</p>
  
  <pre><code>Explain Result:
  ---------------------------------------------------------------------------
  id|selecttype|table |type|possiblekeys|keys|key_len|ref |rows|  Extra       
  ---------------------------------------------------------------------------
  1 | SIMPLE   |tablen|ALL |  null      |null|null   |null|1099|Usingfilesort 
  ---------------------------------------------------------------------------
  </code></pre>