ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Maintain Spatial Index (Environment setting)

  • Usage notes
  • Dialog syntax
  • Scripting syntax

Tools that honor the Maintain Spatial Index environment delete and re-create the spatial index of an enterprise geodatabase feature class, or keep it in place and update it, according to the setting.

Maintain Spatial Index allows you to control how the spatial index for enterprise geodatabase feature classes is managed during geoprocessing operations (such as Append and Delete_Features) that insert, update, or delete data in an existing feature class. When set to False, the spatial index of the target feature class is deleted prior to any insert, update, or delete operation. When processing is complete, the spatial index is re-created. When set to True, the spatial index of the output feature class is not deleted prior to the start of processing. It is kept in place during the insert, update, or delete operation and is automatically updated afterward. If the feature class being updated does not have a spatial index, nothing is done as far as the spatial index is concerned; a spatial index is not added. See The spatial grid index for more information on enterprise geodatabase spatial indexes.

Usage notes

  • If the operation you are performing includes a large number of inserts, updates, or deletes relative to the total number of features in your feature class, leave Maintain Spatial Index set to False to potentially gain better performance.
  • Performance of operations that include a small number of inserts, updates, or deletes relative to the total number of features in your feature class (for example, inserting 30 features into a feature class containing one million features) may be improved by setting Maintain Spatial Index to True and allowing the system to update the existing spatial index automatically.

Dialog syntax

  • Checked—The spatial index is left in place and updated after processing.
  • Unchecked—The spatial index is dropped before processing and re-created at the end. This is the default.

Scripting syntax

arcpy.env.maintainSpatialIndex = boolean_option

ParameterExplanation

boolean_option

If True, the spatial index is left in place and updated after processing.

If False, the spatial index is dropped before processing and re-created at the end. This is the default.

maintainSpatialIndex syntax

Script example

import arcpy

# Set the maintainSpatialIndex environment to True
arcpy.env.maintainSpatialIndex = True
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal