How to get coordinates from database and show them on the map fast : I have a database which has lots of car locations(coordinates; lat,lng). I want to get the location of the cars just by giving the coordinates to server and get the locations very fast. The problem is that the number of cars is numerous and if there are millions of records in a table, when requesting with

    select * from locations where (lat >= '$lat-10' and lat <= '$lat+10') and (lng >= '$lng-10' and lng <= '$lng+10')

it might be normal but it compares millions of coordinates with four conditions and it utilizes resources very much. So is there any algorithm to find the locations very fast? I thought whether it is a good idea to categorize the map of my country with squares and put each section to a separate table in order to find the locations fast. So if a user wants to find the location of a car just by giving her/his current coordinates, SQL will search only in the section(table) that the user currently is. But now the problem is that the number of tables will grow much, maybe 100,000 tables!!

How can I find the location of cars fast?
Thanks