I'm trying to design a MySQL schema that can store a list of users with an associated latitude and longitude.
I would then, for a given user, like to build a query which can return the nearest 50 users to him/her and sort those users by distance (with the nearest being presented first).
Given that there may be many thousands of users in this table, what is the most efficient way to store and query this data?