SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-239
UPDATE STATISTICS Statement
UPDATE STATISTICS Statement
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 partitions of SQL/MX tables.
UPDATE STATISTICS is an SQL/MX extension.
table
names the table for which statistics are to be updated. To refer to a table, use one
of these name types:
Guardian physical name
ANSI logical name
DEFINE name
See Database Object Names on page 6-12.
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]...
column-list for a single-column group is:
column-name | (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] [SET ROWCOUNT c ]
sample-option is:
[r ROWS]
| RANDOM percent PERCENT [CLUSTERS OF blocks BLOCKS]
| PERIODIC size ROWS EVERY period ROWS