Indexes provide a shortcut to the data. Similar to an index in a book—which provides a list of key phrases to help you locate information—indexes defined on a hosted feature layer or hosted table help the software locate the information it needs when it queries the layer.
Multiple types of indexes are used to improve query performance for hosted feature layers and tables. Some are defined by ArcGIS Online and others you can define. Each one is designed to improve the performance of a specific type of query or meet a specific requirement.
You must be the owner of the item or an organization administrator to add or manage an index.
Rebuild the spatial index
Spatial indexes improve the performance of spatial queries, such as drawing features on a map or searching for features.
A spatial index is created for the hosted feature layer when you publish it. If you or other editors add features to the layer that are outside the initial extent of the layer, the spatial index becomes outdated and you may need to rebuild it. For example, if the hosted feature layer contained features in only one city and you later append data that adds features across the country, you should rebuild the spatial index for that layer.
In general, if you find that the layer is drawing more slowly than it used to and you know a large number of features have been added to the layer outside the initial extent, rebuild the spatial index. Spatial indexes are defined on the spatial field of the feature layer.
To rebuild the spatial index on a layer, complete the following steps:
- Sign in to the organization as the owner of the hosted feature layer or as an organization administrator.
- Open the item page for the hosted feature layer.
- Click the Settings tab.
- Scroll to the Manage indexes section.
- Ensure that the Spatial indexes tab is selected, and click Rebuild indexes.
- Enable the toggle button next to the sublayer or sublayers for which you want to re-create the spatial index, and click Rebuild.
Note:
While the spatial index is rebuilt, users of the layer will likely see slower performance. If possible, rebuild spatial indexes when the layer is not in use.
Add indexes to attribute fields
Attribute and full-text indexes can decrease the time it takes for queries, such as searches or filters, to find the data requested.
If you notice that it takes a long time to get results when you filter or apply a definition based on the nonspatial attributes in a table or layer, you can add an index to the field or fields to possibly improve query performance.
You can add attribute indexes to any of the field types ArcGIS Online supports. If filters or definitions need to find specific words or phrases in a string field, you can add a full-text index.
If users are searching or querying a single field at a time, define an index for that one field. If a single search or query runs on multiple fields, you can define an index on all the fields that are frequently queried together.
It is recommended that you do not add indexes to fields that are edited frequently, because it can take longer to update a field that has an index defined on it. There is also no point in adding an index for fields that will not be queried.
Indexes use a small amount of space in the feature database and, as a result, may use credits.
Add an attribute index
To add an attribute index to a field or fields in a layer or table in a hosted feature layer, complete the following steps:
- Sign in to the organization as the owner of the hosted feature layer or as an organization administrator.
- Open the item page for the hosted feature layer.
- Click the Settings tab.
- Scroll to the Manage indexes section.
- Click the Field indexes tab.
- Use the Layer or table drop-down list to choose the correct layer or table.
- Click Add index.
- Choose Attribute and click Next.
- Select the field to which the attribute index will be added, and click Add to list.
To define an index that includes multiple fields, select the additional field, and click Add to list again.
You can include up to 16 fields in an attribute index. An index defined on multiple fields is useful for queries that query all the fields at once.
- In nearly all cases, leave the Ascending option set.
Create a descending order index if the queries that run on the fields are descending order queries.
- If the field to which you are adding the index contains unique values and will always contain unique values, enable the Field values are unique toggle button to create a unique index.
If there are multiple fields in the index, the combination of values across the multiple fields must be unique if you enable the Field values are unique toggle button. As long as one of the multiple fields contains unique values, the combination of values across all the fields in the index will be unique.
- Click Create index.
The amount of time it takes to create the index depends on how many attributes or rows are in the layer or table.
The index is created and appears in the list of indexes on the Field indexes tab.
Add a full-text index to string attribute fields
To add a full-text index to a string field in a layer or table in a hosted feature layer, complete the following steps:
- Sign in to the organization as the owner of the hosted feature layer or as an organization administrator.
- Open the item page for the hosted feature layer.
- Click the Settings tab.
- Scroll to the Manage indexes section.
- Click the Field indexes tab.
- Use the Layer or table drop-down list to choose the correct layer or table.
- Click Add index.
- Choose Full text and click Next.
- Select the string field to which the full-text index will be added, and click Add to list.
The field you specify can participate in only one index.
- Click Create index.
The amount of time it takes to create the index depends on how many attributes or rows are in the layer or table.
The index is created and appears in the list of indexes on the Field indexes tab.
Add a columnstore index
Columnstore indexes can improve the performance of calculations or aggregations used in reports, dashboards, charts, or graphs when the layer or table contains large amounts of data (millions or more features or rows).
For example, if you configure a chart in Map Viewer that shows the sum of multiple fields in a feature layer, and you notice that it takes multiple seconds or more to render the chart, adding a columnstore index to those fields in the feature layer may decrease the amount of time it takes to draw the chart. Similarly, if you create a dashboard that represents calculated values in a graph, and it takes a while to load the dashboard, a columnstore index on the fields included in the calculation may help.
You can add one columnstore index per sublayer or table in a hosted feature layer.
To add a columnstore index to a field, complete the following steps:
- Sign in to the organization as the owner of the hosted feature layer or as an organization administrator.
- Open the item page for the hosted feature layer.
- Click the Settings tab.
- Scroll to the Manage indexes section.
- Click the Columnstore indexes tab, and click Add index.
Add index is inactive if all the sublayers in the hosted feature layer have a columnstore index defined.
The Columnstore indexes pop-up appears.
- Use the Layer drop-down menu to choose the sublayer to which you will add the columnstore index.
- Check the boxes next to the fields that you want to be indexed.
If you know the names of the fields, type them, one at a time, in the Search fields text box. As you type, the list of matching fields updates to help you find the field you need.
- Click Create index.
Index creation may take several seconds to complete.
When the index is created, the Columnstore indexes pop-up closes. The new index is listed on the Columnstore indexes tab.
Delete indexes
If you notice that the added index has not improved query performance or has decreased query or editing performance, you can delete the index.
You can also delete an index if you decide you need an index with a different definition—for example, you want to add a field to the index because two fields are frequently queried together. In that case, you must delete the existing index and create another index that includes all the fields you need in the index.
Note:
You cannot delete the spatial index.
Other actions that you perform on the data outside this interface also create indexes. For example, when you configure a search for a web map's contents, indexes are created on the layers in the web map. Similarly, when you add a filter to a layer in a web map, Map Viewer adds indexes to fields in the layer.
ArcGIS Online also creates indexes on editor tracking fields, and the layer's object ID and feature ID. All of these system field indexes have a lock symbol next to them, and you cannot delete them.To delete an attribute, full-text, or columnstore index from a layer or table in a hosted feature layer, complete the following steps:
- Sign in to the organization as the owner of the hosted feature layer or as an organization administrator.
- Open the item page for the hosted feature layer.
- Click the Settings tab.
- Scroll to the Manage indexes section.
- To delete an attribute or full-text index, click the Field indexes tab, and do the following:
- Choose the layer or table from which to remove the index.
- Click the Delete button
next to the index to remove it from the layer or table.A confirmation pop-up appears.
- To confirm that you want to delete the index, click OK.
- To delete a columnstore index, click the Columnstore indexes tab, and do the following:
- Click the Delete button
next to the index to remove it from the layer or table.A confirmation pop-up appears.
- Click Confirm to delete the index.
- Click the Delete button