Spatial indexes are used with queries in Oracle and PostgreSQL that call functions to compare geometries. The Oracle and PostgreSQL ST_Geometry functions that use spatial indexes are the ones that test spatial relationships.
- ST_Contains (PostgreSQL)
- ST_Crosses
- ST_Disjoint (PostgreSQL)
- ST_Equals
- ST_Intersects
- ST_Overlaps
- ST_Relate (Oracle)
- ST_Touches
- ST_Within
Additionally, the spatial column must appear immediately after the spatial relationship function in the query for the spatial index to be used.