Remove Attribute Index (Data Management)

Summary

This tool deletes an attribute index from an existing table, feature class, shapefile, or attributed relationship class.

Attribute indexes are used by ArcGIS to quickly locate records that match an attribute query.

Usage

  • This tool accepts as input shapefiles, geodatabase feature classes, and attribute relationship classes.

  • If the Index Name parameter is empty, there are no attribute indexes in the dataset.

  • Once an index has been added, it can be deleted and re-added at any point in the lifetime of the feature class or table.

  • For enterprise geodatabase data that is not registered as versioned, you may delete both unique or non-unique indexes on GlobalID fields. However, if you do remove the index on a GlobalID field, it is recommended that you re-add an index on the GlobalID field to improve performance for attribute queries on the feature class or table.

Syntax

RemoveIndex(in_table, index_name)
ParameterExplanationData Type
in_table

The table containing the index or indexes to be deleted. Table can refer to an actual table, a feature class attribute table, or an attributed relationship class.

Table View; Raster Layer; Mosaic Layer
index_name
[index_name,...]

The name of the index or indexes to be deleted.

String

Derived Output

NameExplanationData Type
out_table

The updated input table.

Table View; Raster Layer; Mosaic Layer

Code sample

RemoveIndex example 1 (Python window)

The following code demonstrates how to use RemoveIndex tool in immediate mode.

import arcpy
arcpy.env.workspace = "C:/data/input/indices.gdb"
arcpy.RemoveIndex_management("lakes", ["IndexA", "IndexB"])
RemoveIndex example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the RemoveIndex tool.

import arcpy
 
# Set a default workspace
arcpy.env.workspace = "c:/data"
 
# Remove two indexes from the feature class
arcpy.RemoveIndex_management("/county.gdb/lots", ["indexa", "indexb"])

Environments

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics