Creates a spatial index on an existing column or set of columns.
| Attribute | Description | Required For | Supports |
|---|---|---|---|
| catalogName | The name of the catalog. | all | |
| schemaName | The name of the schema. | all | |
| tableName | The name of the table to which the index will be added. | all | all |
| indexName | The name of the index to create. | mysql, oracle, postgresql | mysql, oracle, postgresql |
| tablespace | The tablespace in which the index will be created. | oracle, postgresql | |
| geometryType | The geometry type of the data to be indexed (e.g. Geometry, Point, MultiLineString, Polygon, GeometryCollection, etc). | oracle | |
| srid | The Spatial Reference ID of the data to be indexed. | derby, h2 | derby, h2, oracle |
As a Best Practice, the geometryType and srid attributes should always be provided and match those in the geometry column type.
| Name | Description | Required For | Supports | Multiple Allowed |
|---|---|---|---|---|
| columns | Column(s) to add to the index See the column tag document for more information. |
all | all | postgresql |
<changeSet id="1" author="bob">
<spatial:createSpatialIndex tableName="home" indexName="home_location_idx" geometryType="Point" srid="4326">
<column name="location" />
</spatial:createSpatialIndex>
</changeSet>
| Database | Notes | Auto Rollback |
|---|---|---|
| Derby | The table must contain a numeric primary key column. Only one spatial index per table is allowed. | Yes |
| H2 | The table must contain a numeric primary key column. Only one spatial index per table is allowed. | Yes |
| MySQL | Supported | Yes |
| Oracle | Supported | Yes |
| PostgreSQL | Supported | Yes |