Updates indexes of datasets and system tables stored in an enterprise geodatabase. Rebuilds existing attribute or spatial indexes. Updates database statistics of base tables, delta tables, and archive tables, along with the statistics on those tables indexes.
| Parameter | Type | Description | Required |
|---|---|---|---|
| Workspace | String | Path to SDE connection file | Yes |
| excludeList | List | List of object names to exclude from being processed. | No |
| include_system | Boolean | Indicates whether statistics will be gathered on the states and state lineages tables.
|
No |
| delta_only | Boolean | Indicates how the indexes will be rebuilt on the selected datasets.
|
No |
| only_versioned | Boolean | Indicates if indexes will only be rebuilt for objects that are versioned.
|
No |
| analyze_base | Boolean | Indicates whether the selected dataset base tables will be analyzed.
|
No |
| analyze_delta | Boolean | Indicates whether the selected dataset delta tables will be analyzed.
|
No |
| analyze_archive | Boolean | Indicates whether the selected dataset delta tables will be analyzed.
|
No |
Returns: Boolean
Simple call with all parameters specified.
import RPLib dataOwner = "C:/GIS/GISADMIN@GIS.sde" # Exlude tables that have the below variations in their name from the process. # Views will typically throw errors with this tool. excludeList = ['VW_', '_VW', 'V_', '_V',] RPLib.rebuild_indexes_analyze(dataOwner, excludeList, False, True, False, True, True, True)
Simple call with only required parameters specified.
import RPLib dataOwner = "C:/GIS/GISADMIN@GIS.sde" RPLib.rebuild_indexes_analyze(dataOwner)
If Else logic with all parameters specified.
import RPLib dataOwner = "C:/GIS/GISADMIN@GIS.sde" # Exlude tables that have the below variations in their name from the process. # Views will typically throw errors with this tool. excludeList = ['VW_', '_VW', 'V_', '_V',] if RPLib.rebuild_indexes_analyze(dataOwner, excludeList, False, True, False, True, True, True): print("successful, run another tool") else: print("failed, run another tool")
- Notice you do not need to specify these parameters because by default:
excludeList = Is an empty list by default
- include_system = False
- You must be the geodatabase administrator for this option to be True.
delta_only = True
analyze_base = True
analyze_delta = True
analyze_archive = True
include_system = True
import RPLib dataOwner = "C:/GIS/GISADMIN@GIS.sde" if RPLib.rebuild_indexes_analyze(dataOwner): print("successful, run another tool") else: print("failed, run another tool")