OceanBase Database supports the creation of spatial indexes using the syntax for creating regular indexes, but with the use of the SPATIAL keyword.
The following limitations are related to creating spatial indexes:
The column definition for creating a spatial index must include the
NOT NULLconstraint.After the index is created, comparisons are performed using the coordinate system corresponding to the Spatial Reference Identifier (SRID) specified in the column definition. The spatial index stores the Minimum Bounding Rectangle (MBR) of the geometry objects, and the comparison of MBRs also relies on the SRID.
It is recommended to have the SRID defined for the column on which the spatial index is created. Otherwise, the spatial index created on that column will not be effective during queries.
References
For more information about how to create a spatial index, see Create a spatial index.