title: MySQL SELECT DISTINCT ... ORDER BY without a temporary table or filesort
body: <p>I have a query running on a table with half a million rows.  I have a composite index called wafer_name_date on the columns (wafer_name, date).  By adding the index, this query now takes .06 seconds, but still reports using a temporary table and filesort.  Is there any way to avoid this?  thanks!</p>
  
  <pre><code>EXPLAIN SELECT DISTINCT wafer_name FROM flash ORDER BY date\G 
  *************************** 1. row ***************************
             id: 1
    select_type: SIMPLE
          table: flash
           type: range
  possible_keys: NULL
            key: wafer_name_date
        key_len: 767
            ref: NULL
           rows: 4308
          Extra: Using index for group-by; Using temporary; Using filesort
  </code></pre>