Coding Thread, Determine Users within X Radius by Postcode in Coding and Web Development; I have two database tables:
The first which is a table of postcodes (around 1.7 million records) and has a ...
25th August 2011, 11:00 AM #1
- Rep Power
Determine Users within X Radius by Postcode
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?
25th August 2011, 11:43 AM #2
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!
By tosca925 in forum Windows
Last Post: 23rd May 2011, 08:31 PM
By mattx in forum Jokes/Interweb Things
Last Post: 13th August 2009, 10:52 PM
Last Post: 8th November 2008, 10:04 AM
By academic_mwnci in forum MIS Systems
Last Post: 3rd September 2008, 12:02 AM
By mmoseley in forum Network and Classroom Management
Last Post: 11th July 2007, 08:50 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)