Modify a spatial index

Functionality limited in Basic.

For all other geodatabases and spatial types, you seldom need to manage the spatial index. However, if you experience a decrease in spatial query performance after adding or deleting a large number of features, you may see improved spatial query performance if you rebuild (Oracle) or re-create the spatial index on the affected feature class.

You may need to modify the spatial index of a feature class in the following situations:

  • If you experience poor performance when using the feature class, rebuild or recalculate the spatial index.
  • If you added or deleted a large number of features in SQL Server and the feature class spatial data type is Geometry, validate the spatial index to determine if you need to recalculate it or if you need to update the feature class extent instead.
    Tip:

    You can see what type of geometry storage is used for your feature class by looking at the Storage property on the Source tab of the Feature Class Properties dialog box.

  • You want to append or copy a large number of features to an existing feature class. In this case, you can delete the spatial index before you add the data. This is not required, but deleting the spatial index can improve performance for the data loading operation. Create a new spatial index when you finish adding the features.
Note:

Rebuilding, recalculating, or creating a spatial index for a feature class in an enterprise geodatabase is a server-intensive operation. It should not be done on large feature classes when many users are logged in to the server.

Also note that you must have ArcGIS Desktop Advanced or Desktop Standard to modify the spatial index of a feature class in an enterprise geodatabase.

Rebuild or recalculate a spatial index

To rebuild or recalculate a spatial index on a feature class in a file geodatabase or an enterprise geodatabase in Oracle, Db2, PostgreSQL, or SQL Server (using the Geography spatial type), follow these steps:

  1. In the Catalog pane, connect to the geodatabase that contains the feature class with the spatial index you want to modify.

    For enterprise geodatabases, connect as the feature class owner.

  2. Right-click the feature class and click Properties.
  3. Click the Indexes tab.
  4. Expand the Spatial Index section.
  5. Click Recalculate (or Rebuild if your feature class is in Oracle).
    The recalculated index reflects the current data.
  6. Click OK to close the Feature Class Properties dialog box.

Validate a spatial index in SQL Server (Geometry)

To determine if you should recalculate the spatial index or extent on a poorly performing feature class that uses the Geometry spatial type in SQL Server, validate the spatial index.

  1. In the Catalog pane, connect to the geodatabase that contains the feature class with the spatial index you want to modify.

    For enterprise geodatabases, connect as the feature class owner.

  2. Right-click the feature class and click Properties.
  3. Click the Indexes tab.
  4. Expand the Spatial Index section.
  5. Click Validate to determine if it is necessary to recalculate the spatial index. Validation returns one of the following messages:
    • The spatial index bounding box matches the feature class extent.—If you receive this message, you do not need to recalculate the spatial index. Click OK to close the Feature Class Properties dialog box.
    • The spatial index bounding box and feature class extent do not match. Recalculate the spatial index.—If you receive this message, click Recalculate.
    • The spatial index bounding box and feature class extent do not match. Run the Recalculate Feature Class Extent geoprocessing tool.—If you receive this message, click OK to close the Feature Class Properties dialog box, and run the Recalculate Feature Class Extent tool on this feature class.

Delete a spatial index

If you want to add a large number of features to an existing feature class in a single operation, you can delete the spatial index to decrease the amount of time it takes to add the new features. Once the new features are added, be sure to create a spatial index on the feature class.

  1. In the Catalog pane, connect to the geodatabase that contains the feature class with the spatial index you want to delete.

    For enterprise geodatabases, connect as the feature class owner.

  2. Right-click the feature class and click Properties.
  3. Click the Indexes tab.
  4. Expand the Spatial Index section.
  5. Click Delete and click OK to close the Feature Class Properties dialog box.
  6. Append or copy rows into the feature class.
  7. Open the Feature Class Properties dialog box for the feature class again, expand the Spatial Index section, and click Create.

    A new spatial index is added to the feature class, and it includes the newly added features.

  8. Click OK to close the Feature Class Properties dialog box.