I have a record of businesses with half a million records including zip code. I want to search for businesses within e.g 15 miles of 49931. I have a function that returns the distance between 2 zip codes but the issue is: going thru each recordset to determine the distance to 49931 takes forever and never returns. Is there a better way to this? databse is MySQL
hmmm, the only thing i can think of, is you make new tables for say 15miles table and put all the 2 zip codes that have that distance ...and so on. This will make your database a lot bigger though, but it would be only a matter of a select * after that to display them. or....try using LIMIT with your query and return only 20-30 records at a time..