ALLBASE/SQL Reference Manual (36216-90216)

Chapter 12 585
SQL Statements S - Z
UPDATE STATISTICS
UPDATE STATISTICS
The UPDATE STATISTICS statement updates the system catalog to reflect a table's current
characteristics, such as the number of rows and average row size. ALLBASE/SQL uses
these statistics to choose an optimal way to process a query.
Scope
ISQL or Application Programs
SQL Syntax
UPDATE STATISTICS FOR TABLE {[
Owner.
]
TableName
SYSTEM.
SystemViewName
}
Parameters
[
Owner
.]
TableName
identifies a table.
SYSTEM.
SystemViewName
identifies a system view.
Description
The UPDATE STATISTICS statement affects specific columns in certain system catalog
views:
View Name Columns Affected
SYSTEM.DBEFILE DBEFUPAGES
SYSTEM.DBEFILESET DBEFSUPAGES
SYSTEM.COLUMN AVGLEN
SYSTEM.INDEX CCOUNT
NPAGES
SYSTEM.TABLE AVGLEN
NPAGES
NROWS
USTIME
Any sections that reference a table named in the UPDATE STATISTICS statement are
marked invalid, but are revalidated the next time they are executed or the VALIDATE
statement is issued if access and authorization criteria are satisfied.
Use this statement sparingly before preprocessing, after creating an index, and after
periods of heavy update activity. For more information, on the UPDATE STATISTICS
statement, refer to the
ALLBASE/SQL
Performance Guidelines
.