I use mysql to store geolocation data. I would like to know how to optimize a table containing coordinates (x, y) so that queries are optimized against it. (x, y will be lat / long).
for example, I have a table with the following fields: id, x, y, notes.
after a while I will select the query: Select * from the geoloc where sqrt ((x- @x) ^ 2 + (y- @y) ^ 2) delta
Please note: I donβt know how the actual SQL statement will work right now, so the above is just a very crude idea of ββwhat I want.
What do I need to do to optimize this table for this type of query? any pointers are welcome.
source share