educative.io

Index where ‘key’ is the grid number and ‘value’ is the list of places contained in that grid

Should we keep our index in memory? Maintaining the index in memory will improve the performance of our service. We can keep our index in a hash table where ‘key’ is the grid number and ‘value’ is the list of places contained in that grid.

is there a big benefit of this index? after we get the places in the grid, we still need to get if the lat/long of each place is within the bounds specified in the query.