Rebuild Geospatial Indexes

  • Before you upgrade server versions, you must back up your geospatial indexes in a temporary table. After you upgrade, use STV_Create_Index with the temporary table as input to rebuild the index, and set the overwrite parameter to true to prevent a failure if there is an existing index with the same name:

    => SELECT STV_Create_Index(gid, geometry USING PARAMETERS index='pol_idx_new', overwrite=true) OVER() FROM temp-table;
       type   | polygons | SRID | min_x | min_y | max_x | max_y | info
    ----------+----------+------+-------+-------+-------+-------+------
     GEOMETRY | 1        | 0    | 1     | 1     | 3     | 3     |
    (1 row)
  • Now, you can use the index pol_idx_new in the Place version.