title: Select MAX or Order By Limit 1
body: <p><a href="https://stackoverflow.com/questions/426731/min-max-vs-order-by-and-limit">MIN/MAX vs ORDER BY and LIMIT</a></p>
  
  <p>To follow up on this question: I found some results very different from what Sean McSomething describes:</p>
  
  <p>I have a table with about 300M rows.</p>
  
  <p><code>Select max(foo) from bar;</code> takes about 15 sec. to run</p>
  
  <p><code>Select foo from bar order by foo desc limit 1;</code> takes 3 sec. to run</p>
  
  <p>Sean's statement "It looks like MIN() is the way to go - it's faster in the worst case, indistinguishable in the best case" just doesn't hold for this case...but I have no idea why. Can anyone offer an explanation?</p>
  
  <p>Edit: Since I am unable to show the table's structure here: assume that bar is a table in an ndb_cluster with no relations, foo is an arbitrary data point with no index.</p>