Menu
Amazon Relational Database Service
User Guide (API Version 2014-10-31)

Amazon Aurora and Spatial Data

Amazon Aurora supports the same Spatial Data Types and Spatial Relation Functions as MySQL 5.6. Amazon Aurora also supports spatial indexing on InnoDB tables, similar to that offered by MySQL 5.7, which improves query performance on large datasets for queries that use spatial data. Note that Amazon Aurora uses a different indexing strategy than MySQL, using a space-filling curve on a B-tree instead of an R-tree.

The following data definition language (DDL) statements are supported for creating indexes on columns that use spatial data types.

CREATE TABLE

You can use the SPATIAL INDEX keywords in a CREATE TABLE statement to add a spatial index to a column in a new table. For example:

Copy
CREATE TABLE test (shape POLYGON NOT NULL, SPATIAL INDEX(shape));

ALTER TABLE

You can use the SPATIAL INDEX keywords in an ALTER TABLE statement to add a spatial index to a column in an existing table. For example:

Copy
ALTER TABLE test ADD SPATIAL INDEX(shape);

CREATE INDEX

You can also use the SPATIAL keyword in a CREATE INDEX statement to add a spatial index to a column in an existing table. For example:

Copy
CREATE SPATIAL INDEX shape_index ON test (shape);