Analytics

Add multiple attribute indexes for feature classes or mosaic datasets

By Aileen Buckley, PhD, Esri Research Cartographer

Add Attribute Indexes thumbnail

Have you ever needed to create multiple indexes for either a feature class or mosaic dataset? The Add Indexes script tools help you speed up that process by automatically creating indexes for the fields you select. The Add Feature Class Indexes script tool adds attribute indexes to an existing feature class or overwrites its existing indexes. The Add Mosaic Dataset Indexes script tool adds attribute indexes to an existing mosaic dataset or overwrites its existing indexes.

Add Mosaic Dataset Indexes tool

For these tools, the list of fields to index is extracted from the feature class or mosaic dataset.

Fields to Index

The indexes will be single column/field indexes, with default characteristics of UNIQUE and ASCENDING. Index naming will follow the recommended naming convention for attribute indexes (that is, FieldName_IDX). The field name in the index will be truncated since the length of an index name is limited to 10 characters, including the _IDX suffix. Vowels will be removed. and names will be reduced to 6 characters, plus _IDX. For example, the index name for a field named Start_Time will be STRT_T_IDX.

Added Attribute Indexes

Duplicate index names may result because of this truncation. If this happens, the index will only be created for the last field with a duplicate name. For example, two fields named Control and Central will both be truncated to CNTRL_, resulting in duplicate index names of CNTRL_IDX. If the first field in the attribute table is Control and the second is Central, an index will be added for the Control field, then it will be deleted when the index is added for the Central field. As a result, the first field will not have an index. This can be created using the standard method after the tool has been used to create the other indexes.

These tools were developed to support the workflow associated with creating historical map collections and sharing them online. Keep an eye on this blog to find out more about when the documentation for that workflow, and associated downloadable resources, will be available. The documentation will include step-by-step instructions for using these tools and the download includes sample data that you can use to test out the workflow and these tools.

To learn more about creating attribute indexes, see desktop.arcgis.com/en/arcmap/latest/manage-data/tables/creating-attribute-indexes.htm.

Thanks to Steven Lambert, Esri, for writing the code for these tools!

Next Article

Make This Dymaxion Globe Ornament Please

Read this article