Creating spatial grid indexes
You can use the ST_create_index stored procedure to create spatial grid indexes to define two-dimensional grid indexes on spatial columns to help optimize spatial queries.
Before you begin
Before you create a spatial grid index:
- The user ID that invokes the ST_create_index stored procedure
must hold one of the following authorities or privileges:
- SYSADM or DBADM authority on the database that contains the table where the spatial grid index will be used
- Ownership or INDEX privilege on the table
- You must know the values that you want to specify for the fully-qualified spatial grid index name and the three grid sizes that the index will use.
About this task
You create spatial grid indexes to improve the performance of queries on spatial columns. When you create a spatial grid index, you give it the following information:
- A name
- The name of the spatial column on which it is to be defined
- The combination of the three grid sizes, which helps optimize performance by minimizing the total number of index entries and the number of index entries that need to be scanned to satisfy a query
Restriction: The Db2 LOAD utility will fail if a spatial grid
index is created on the target table. Before running this utility,
you must drop the spatial grid index by using the ST_drop_index stored
procedure. You can create the spatial grid index again after running
the LOAD utility.
Procedure
To create a spatial grid index:
Invoke the ST_create_index stored procedure.
For
information about this stored procedure, see ST_create_index.