i am using mysql to store geolocation data. i would like to know how to optimize the table holding the (x,y) coordinates so that queries will be optimized against it. (the x,y will be lat/long).
for example, i have a table with the following fields: id, x, y, notes.
at sometime later, i will perform a query: select * from geoloc where sqrt( (x-@x)^2 + (y-@y)^2 ) < delta
please note, i have no idea how the actual SQL statement will work right now, so the above is just a very rough idea of what i want.
so what do i have to do to optimize this table for this type of query? any pointers are greatly appreciated.