I work on the map and keep the locations in the database.
There are different locations of the map on the table. There are many locations within the table. Now different users come and click on different position on the map, so I have to select a query in the database to find each location. Is this correct? That means I run a query for every click.
In my opinion, specify a dimension(area), and whenever these dimensions are loaded, I select all the locations within those dimensions to avoid additional query select to database.
What is the best optimization way?