About updating geodatabase statistics
About updating geodatabase statistics
|
Release 9.3 |
|
Database management systems (DBMSs) determine the most efficient way to execute the queries sent to them based on database statistics. Therefore, for optimal performance of datasets created within ArcSDE geodatabases, you need to keep the statistics current by frequently updating the database statistics.
When a feature class is registered as versioned, the adds and deletes tables are created to hold the business table's added and deleted records. The version registration process automatically updates the statistics for all the required tables at the time it is registered. After that, as changes are made to the feature class, the distribution of information in the tables and indexes changes, causing the database statistics to become outdated.
You can update the statistics of feature classes from within ArcCatalog, no matter what supported database you use to store your data. This is the preferred method for updating statistics. For instructions on updating database statistics, see either Updating statistics on a geodatabase licensed under ArcGIS Server Enterprise or Updating statistics on geodatabases on ArcSDE database servers.
For ArcSDE geodatabases licensed under ArcGIS Server Enterprise, you can also use the update_dbms_stats operation of the sdetable administration command to update the statistics for the tables and indexes of a feature class. The update_dbms_stats operation updates the statistics for all the tables of a feature class that require statistics. To have the update_dbms_stats operation update the statistics for all the required tables, do not specify the –K (schema object) option.
sdetable –o update_dbms_stats –t railroad –m compute –u bruno –p pj
When you update statistics using ArcGIS, the statistics of a table's indexes are automatically computed, so there is no need to separately generate statistics for the indexes. However, if you need to separately update index statistics—for example, if you updated a table's statistics using a DBMS tool—you can use the sdetable update_dbms_stats operation with the –n option and the index name.
The example below illustrates how the statistics for the stormdrain_idx index of the stormdrain business table can be updated.
sdetable –o update_dbms_stats –t stormdrain –K B –n stormdrain_idx –u me –p dontlook
For details on the use of the sdetable command, consult the ArcSDE Administration Command Reference provided with the ArcSDE component.
Database statistics should be updated in the following instances:
- After you perform major operations, such as creating new datasets, adding or removing topology rules, or loading large amounts of new data into existing objects.
- On a regular basis to maintain statistics made stale by edits to existing data; for actively edited geodatabases, updating statistics once a week should maintain acceptable performance.
NOTE: Updating database statistics is an input/output (I/O)-intensive operation. You should plan to update statistics when database traffic is at its lightest.
As stated above, it is recommended that you update your database statistics through ArcCatalog or by using the sdetable –o update_dbms_stats command. However, most DBMSs provide tools you can use for statistics on ArcSDE geodatabases licensed through ArcGIS Server Enterprise. Be cautious using these tools, though; in most cases, you will need to update the statistics of each individual table that makes up, for instance, a feature class because the DBMS is not aware of the connection between these tables.
These tools, and certain DBMS settings related to updating statistics, are described in the following sections. The following topics discuss updating statistics for different DBMSs:
Updating geodatabase statistics in DB2 databasesUpdating geodatabase statistics in Informix databasesUpdating geodatabase statistics in Oracle databasesUpdating geodatabase statistics in PostgreSQL databasesUpdating geodatabase statistics in SQL Server databases