To optimize spatial queries, spatial indices are supported on the Geometry
columns of regular tables (not shapefiles). The syntax is the following:
The spatial index is stored on disk. Several spatial operators (such as the
&& predicate operator for bounding box overlap) use this index.
In this example, we calculate the number of roads that intersect several
polygonal areas. First, we create the
roads tables, putting a
spatial index on their Geometry columns:
Now we execute the request:
ST_Intersects does not yet support spatial
indices, but it will in a future release.