eversonj90 Posted August 25, 2011 Posted August 25, 2011 I have two database tables: The first which is a table of postcodes (around 1.7 million records) and has a postcode, longitude and latitude field. The second which is a table of user data, which includes a postcode field - their postcode on registration. I need to be able to determine which users fall within X radius of Y (another users postcode) without ideally running a query to compare distances with all 1.7 million postcodes to shortlist possibles. I was thinking maybe it'd be possible to take Y users postcode and to use their longitude and latitude, doing some math (not my strong point) to determine all possible postcodes - by adjusting the longitude and latitude degrees relative to the distance being searched. Where to start?
InterwebsGuy Posted August 25, 2011 Posted August 25, 2011 This might be helpful: Avoiding a full table scan - comp.databases.mysql | Google Groups I came across it by chance awhile back and bookmarked it for future reference. Interesting stuff!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now