We have stored geography data in "Location" table and based on this column we are searching nearest location for the given input. Below query is used to get the nearest locations within 25 miles and this query takes more than 4 seconds to retrieve 4000 records. We have even created spatial index on location field.We have stored geography data in "Location" tab