Subject Re: [firebird-support] Maths in the queries
Author Hannes Streicher
Hello Lester Caine,




> I am trying to work out a fast way of identifying points of interest within a
> radius of the selected home location ... and potentially there could be 100+
> entries per postcode eventually although probably not 200,000,000 records to scan.

why not reduce your search range for testing first
like

where (lat_h< origin_lat+0.5) and (lat_h>origin_lat-0.5)
(lon_h< origin_lon+0.5) and (lon_h>origin_lon-0.5)

adjust the 0.5 to a little bit more according to the maximum area you want to cover

from a POI Search i wrote a couple of years ago in php/mysql :

SELECT k.*
( ( ( k.geonord-'.$nN.' ) * ( k.geonord-'.$nN.' ) ) + ( ( k.geoost-'.$nO.' ) * ( k.geoost-'.$nO.' ) ) ) AS distance
FROM clients k WHERE k.country = '.$country.
AND abs( k.geonord-'.$nN.' ) < 0.3 AND abs( k.geoost-'.$nO.' ) < 0.3 order by distance limit 0,60





--
Mit freundlichen GrĂ¼ssen
Hannes Streicher mailto:HStreicher@...