Neoview SQL Reference Manual (R2.4 SP2)

UPDATE STATISTICS Statement
NOTE: HP recommends that you update statistics by using the automated UPDATE
STATISTICS stored procedures. The syntax for UPDATE STATISTICS is included here for
reference. For information about automated UPDATE STATISTICS, see the Neoview Database
Administrator's Guide.
“Syntax Description of UPDATE STATISTICS”
“Considerations for UPDATE STATISTICS”
“Examples of UPDATE STATISTICS”
The UPDATE STATISTICS statement updates the histogram statistics for one or more groups of
columns within a table. These statistics are used to devise optimized access plans.
In addition to histogram statistics, UPDATE STATISTICS generates physical statistics (index
level, nonempty block count, and EOF) for Neoview SQL tables.
UPDATE STATISTICS is a Neoview SQL extension.
UPDATE STATISTICS FOR TABLE table [CLEAR | on-clause]
on-clause is:
ON column-group-list CLEAR
| ON column-group-list [histogram-option]
column-group-list is:
column-list [,column-list]...
| EVERY COLUMN [,column-list]...
| EVERY KEY [,column-list]...
| EXISTING COLUMN[S] [,column-list]...
| NECESSARY COLUMN[S] [,column-list]...
column-list for a single-column group is:
column-name
| (column-name)
| column-name TO column-name
| (column-name) TO (column-name)
| column-name TO (column-name)
| (column-name) TO column-name
column-list for a multicolumn group is:
(column-name, column-name [,column-name]...)
histogram-option is:
GENERATE n INTERVALS
| SAMPLE [sample-option]
sample-option is:
[r ROWS]
| RANDOM percent PERCENT
| PERIODIC size ROWS EVERY period ROWS
Syntax Description of UPDATE STATISTICS
table
names the table or materialized view for which statistics are to be updated. To refer to a table,
use the ANSI logical name.
See “Database Object Names” (page 230).
CLEAR
deletes some or all histograms for the table table. Use this option when new applications
no longer use certain histogram statistics.
If you do not specify column-group-list, all histograms for table are deleted.
UPDATE STATISTICS Statement 203