Problem: Display of an ArcSDE raster is too slow even with pyramids built


After loading a raster into ArcSDE, building pyramids, and calculating statistics, it takes an extremely long time for the image to display in ArcGIS. It normally happens on multiband rasters.


The raster tables have not been analyzed for optimization.

Solution or Workaround

There are many ways to create database statistics on raster data stored in ArcSDE or in the Geodatabase :

1. by right clicking the object in ArcCatalog and choosing the 'Analyze' option (check all buttons)
2. by executing the 'sdetable -o update_dbms_stats ...' command from the command prompt.

C:\>sdetable -o update_dbms_stats -t mosaic_test -i 5151 -u test -p XXXXXX -m <ESTIMATE | COMPUTE>

ArcSDE 9.1 Oracle10g Build 372 Mon May 22 12:10:17 PDT 2006
Attribute Administration Utility
DBMS statistics for table mosaic_test updated.
DBMS statistics for raster tables updated.
3. using ArcGIS 9.x "Command Line" option. For information on this, select 'ArcGIS Desktop Help' > select the 'Search' TAB > type ' analyze' > choose ' analyze ' from the results > scroll down to the 'Command Line Syntax' section.

Inside ArcCatalog 9.x select 'Window' from the Toolbar > choose 'Command Line', now in the command line area type the following syntax before hitting enter (you will need to modify the syntax to specify your spatial database connection string, username and object) :

Analyze 'Database Connections\RASTER_ora@BUCCANEERS@5151(esri_sde).sde\RASTER.MOSAIC_TEST' BUSINESS

Analyze 'Database Connections\RASTER_ora@BUCCANEERS@5151(esri_sde).sde\RASTER.MOSAIC_TEST' RASTER
4. using PythonWin

EXAMPLE : START > Programs > Python 2.1 > PythonWin > click ‘File’ > New > Python Script > type the following in the Python Script Window :

#Purpose: Analyze a database table after data loading
#Create the Geoprocessor object
from win32com.client import Dispatch
gp = Dispatch("esriGeoprocessing.GPDispatch.1")

#Set the workspace (to avoid having to type in the full path to the data every time)
gp.Workspace = "Database Connections\TEST_ora@BUCCANEERS@5151(ora_sde).sde"

# Process: Update business rules statistics of a table
print gp.GetMessages()

#If an error occurred while running a tool print the messages
print gp.GetMessages()
5. analyzing the raster data directly in the database (remember to build statistics on all the raster data's associated tables - which is why it is a good reason to use ArcSDE/ArcGIS Tools to accomplish this so no tables are missed).

Oracle :
DBMS_STATS package

SQL Server :