title: MySQL - Making MAX /group by run faster
body: <p>assuming I have the following table</p>
  
  <pre><code>+------------+--------+--------+
  |    date    | Seller | Amount |
  +------------+--------+--------+
  | 2017-03-01 | Anne   |  10.00 |
  | 2017-03-01 | Pete   |  18.00 |
  | 2017-03-03 | Dan    |  20.00 |
  | 2017-03-03 | Dex    |   3.00 |
  | 2017-03-07 | Pete   |     11 |
  | 2017-03-07 | Anne   |   3.00 |
  | 2017-03-08 | Pete   |  12.00 |
  | 2017-03-08 | Dex    |   1.00 |
  | 2017-03-09 | Dan    |  21.00 |
  +------------+--------+--------+
  </code></pre>
  
  <p>my goal is to find the last transaction of a person. my query for this is </p>
  
  <pre><code>SELECT date, Seller, MAX(date)
  FROM transaction
  WHERE date BETWEEN '2017-03-01' AND '2017-03-31' 
  ORDER BY Seller;
  
  +------------+--------+--------+
  |    date    | Seller | Amount |
  +------------+--------+--------+
  | 2017-03-07 | Anne   |   3.00 |
  | 2017-03-08 | Pete   |  12.00 |
  | 2017-03-08 | Dex    |   1.00 |
  | 2017-03-09 | Dan    |  21.00 |
  +------------+--------+--------+
  </code></pre>
  
  <p>unfortunately, with 5 million rows it needs at-least 9 minutes to complete. Any work around to make this faster?</p>