in reply to Zipcode Proximity script

PostgreSQL has built-in "geometric" types which can be used to perform functions like distance. You could select all points within a certain radius, and then sort the points to determine the closest, all at C speeds.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.