I need to organize a Mysql Database of 7,000,000 records. It needs to be queryable by a Lat/Long square, example: 22.54x -134.74x. It also needs to be broken down by month and name. There are about 700 possible names.
I have no clue how to manage all of this data so that someone within that lat/long square can quickly query only the names that exist inside that month and lat/long square.
Do I need 10,000+ tables for every lat/long possibility? Then from there broken down into months and names? My mind is about to explode.
Thanks for your help in advance!
MySQL offers spatial extensions that are specifically designed to efficiently deal with lat/long type problems.
If you use these extensions, a given row would contain the relevant latitude and longitude of a place, and the query would describe the geometric boundary that you are interested in.
Your query can look something along the lines of
This would select places whose location (location here is a spatial column in the database) has a longitude between 0 and 1, and a latitude between 38 and 39.