solidDB Help : Programming : solidDB geohash functions : Performance benefits from using a geohash index
  
Performance benefits from using a geohash index
The database engine is limited to the use of a single index when performing data retrieval queries. This creates a performance challenge when you use regular relational database indexes to index the longitudes and latitudes that are associated with locations. For example, if you are searching for locations by using longitude and latitude co-ordinates, you can use an index to retrieve all the database rows with a matching longitude. However, the results could be anywhere along the line of longitude from the North Pole to the South Pole. To narrow your search, the results must be scanned for a matching latitude.
If you use a geohash index, you can find locations that are within a specified geographic area by using a single index-based search.
The following image illustrates the difference between using a regular index on co-ordinates, and using a geohash index. In both cases, the purpose is to find the two locations in the shaded area close to X.
Diagram to compare finding locations when using a regular index and when using a geohash index
Regular indexing with longitude and latitude co-ordinates
Since it is possible to use only one index in a query (in this case longitude - step #1), all locations that meet the longitude criteria must be scanned (step #2) to find those that meet the latitude criteria. This could result in a serious performance issue.
Indexing with geohash values
By creating an index on geohash values, locations close to each other can be found on the same (or neighboring) geohash block. Filtering out the locations that are on the block but that don't meet the criteria is a less-intensive operation, as there is no need to scan the entire line of longitude from pole to pole.
Go up to
solidDB geohash functions