Sorry if this was already answered (I'm sure someone will throw links at me if it has). I thought a similar question a while back, but I can't find it now.

So, for the question: I'm constructing a user search for a site I'm developing, and one of the search criteria will be based on distance from the searching user. I already have a table of US zip codes and their corresponding Lat/Long. I've also figured out how to determine the bounding box (max lat/min lat - max long/min long) for the determination of which zips fit the criteria (we aren't going to worry about a precise radius. A geographic square will suffice for the time being). My question - how should I structure the query to optimize the speed? Should I:

* Perform the required maths to determine the bounding box, then query the zip table to find all zip codes which are potential candidates followed by a search of users with any of those zip codes?

OR 

* Determine the lat/long bounding box, join the zip table with the user table and return results with users who's lat/longs fall between the parameters?

I imagine the second method will be faster, but I have no supporting evidence/specific experience which suggests that it will. I know enough SQL to get around, but I'm still kind of new to it and have no clue when it comes down to the relative performance of different types of operations. 

Thanks for your time!