Thanks for the compliment.
After creating the indexes, is this query faster? This will give you the most accurate results:
SELECT *, ((ACOS(SIN('29.3356256' * PI() / 180) * SIN(Latitude * PI() / 180) + COS('29.3356256' * PI() / 180) * COS(Latitude * PI() / 180) * COS(('76.9915264' - Longitude) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS distance FROM geonames HAVING distance<='10' ORDER BY distance ASC
In order for this query you would have to trim it down to one decimal place:
select * from geonames where LONGI LIKE '76.9%' AND LAT LIKE '29.3%';
1 degree is 69.2 miles so trimming it down to .1 degree would be 7 miles. Not sure your required accuracy.
Even better (if the first query in this post does not work) would be:
Select * from geonames where LONGI > '76.9415264' AND LONGI < '77.0415264' AND LAT > '29.2856256' AND LAT < '29.3856256';
Where you add and subtract 0.05 from the results from the device to get a 0.1 (7 mile) range...
Let me know how the first query executes.... it should be fast with the index's.