Hi guys,
I'm trying to clean up this query a bit, to make it quicker:
Its currently taking 0.29 seconds, which seems a long time :/ There are only 12,500 odd rows in the glinks_Links table, so I'm a little confused as to why its taking so long?
TIA!
Andy
I'm trying to clean up this query a bit, to make it quicker:
Code:
SELECT
ID, Ville, Title, Image1, Telephone, ExpiryDate,
Address, Postal_Code, Latitude, Longitude,
( 6371 * acos( cos( radians('42.93481749134106') ) * cos( radians( Latitude ) ) * cos( radians( Longitude ) - radians('2.222607135772705') ) + sin( radians('42.93481749134106') ) * sin( radians( Latitude ) ) ) ) AS distance
FROM glinks_Links
HAVING
ExpiryDate < 2147483647
AND ExpiryDate > 131486702
AND distance < '25'
ORDER BY distance LIMIT 10
Its currently taking 0.29 seconds, which seems a long time :/ There are only 12,500 odd rows in the glinks_Links table, so I'm a little confused as to why its taking so long?
TIA!
Andy