zip code radius search

A

Anonymous

Guest
I'm trying to work a zip code radius search, sho all zip codes with in x miles of y zip code, and i have a script that will do this. But...
a) its really slow, how does ebay and yahoo create fast results from queries?
b) does any one have any experience with zip code radius searches?
 
I haven't dealt with this kind of situation myself, but if you could possibly paste some code, some of us oculd try and optimize it for speed. :D
 
Ok well heres is the whole package I bought. I contacted them and they replied saying it all works but when i proved them wrong I havent heard back. So heres your copy free.

<a href=http://www.the-online-classifieds.com/phpZipCodes_US_Database.zip>[ here ]</a>

you can see it at
<a href=http://www.the-online-classifieds.com/test.php>[ here ]</a>
for some reason if you do a query of 14 miles it will work but 15 miles seems to time out.
And for some reason their version http://www.phpzipcodes.com/ will show more results than the version i bought from them. they shoud be the same.
 
Actually, the main search is in "lat" and "lon" which are both floats. Adding an index to those two columns should speed up things...
 
aaaaamazing, it flies now. Never thought of that for some reason. thanks
 
It's a shame that they didn't put that in the install scripts...

Indexes can do miracles if you use them correctly. It will reduce the performance of inserting and updating somewhat, so don't go overboard with tables that are regularly updated.

Coditor
 
Back
Top