Spatial indexes
One of the defining characteristics of a spatial database is the ability to create and use "spatial" indexes to speed up geometry-based searches. These indexes are used to perform spatial operations, such as identifying all the features that lie within a given bounding box, identifying all the features within a certain distance of a given point, or identifying all the features that intersect with a given polygon.
Spatial indexes are one of the most powerful features of spatial databases, and it is worth spending a moment becoming familiar with how they work. Spatial indexes don't store the geometry directly; instead, they calculate the bounding box for each geometry and then index the geometries based on their bounding boxes. This allows the database to quickly search through the geometries based on their position in space:
The bounding boxes are grouped into a nested hierarchy based on how close together they are, as shown in the following illustration:
The hierarchy of nested...