HOW TO

Determine a spatial index size

Last Published: April 25, 2020

Summary

The spatial index for an SDE geodatabase feature class makes queries with spatial filters faster. Determining the optimum spatial index is an iterative process and depends on individual feature geometries that may vary from dataset to dataset. This document demonstrates how to determine a good starting point for a spatial index for a feature class whose feature geometries are relatively uniformly sized. This document uses SDE command line and SQL*Plus. The same process can be used with SQL Server Query Analyzer.

Procedure



  1. Use the sdelayer command to get the layer ID and current statistics for the layer's spatial index.

    Code:
    sdelayer -o si_stats -l <layer_name>,shape -i <instance> -u <username> -p <password>

    The Layer ID will be on the third line that reads: Layer 1 Spatial Index Statistics:
  2. Start SQLPlus and log in as the owner of the layer.
  3. Calculate the average length of a feature envelope's edge and multiply by 3.

    Code:
    select avg((((emaxx - eminx)+(emaxy-eminy))/2)*3) average_edge from<F_table>;


    Note:
    <F_table> is F<layerID>

Article ID:000004594

Software:
  • ArcMap 8 x
  • ArcMap 9 x
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic