title: Possible to calculate closest locations via lat/long in better than O(n) time?
body: <p>I'm wondering if there is an algorithm for calculating the nearest locations (represented by lat/long) in better than O(n) time.</p>
  
  <p>I know I could use the Haversine formula to get the distance from the reference point to each location and sort ASC, but this is inefficient for large data sets.</p>
  
  <p>How does the MySQL DISTANCE() function perform? I'm guessing O(n)?</p>