Skip to main content

Spatial Index

Spatial indexes in Databend accelerate spatial predicate filtering on GEOMETRY columns. They are designed for Fuse tables and help the optimizer prune blocks before evaluating exact spatial functions.

Key Feature: Automatic Index Generation

Spatial indexes are maintained automatically for data written after the index is created. Use REFRESH SPATIAL INDEX when you create an index on a table that already contains data and need to backfill existing rows.

Spatial Index Management

CommandDescription
CREATE SPATIAL INDEXCreates a new spatial index on one or more GEOMETRY columns
REFRESH SPATIAL INDEXBackfills spatial index data for rows that existed before index creation
DROP SPATIAL INDEXRemoves a spatial index from a table

Supported Predicates

Databend can use spatial indexes to accelerate queries built with these spatial predicates:

  • ST_CONTAINS
  • ST_INTERSECTS
  • ST_WITHIN
  • ST_DWITHIN

Limitations

  • Spatial indexes are supported on Fuse tables.
  • Indexed columns must be of type GEOMETRY.
  • GEOGRAPHY columns are not supported.
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today