Syntax Description Of Update Statistics - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

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
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.
If you specify column-group-list, only columns in the group list are deleted.
ON column-group-list
specifies one or more groups of columns for which to generate histogram statistics with the
option of clearing the histogram statistics. You must use the ON clause to generate statistics
stored in histogram tables. If you omit it, physical statistics are generated for Neoview SQL
tables, and SQL returns a warning message. See
column-list
specifies how column-group-list can be defined. The column list represents both a
single-column group and a multi-column group.
Single-column group:
column-name | (column-name) | column-name TO column-name | (column-name)
TO (column-name)
specifies how you can specify individual columns or a group of individual columns.
To generate statistics for individual columns, list each column. You can list each single
column name within or without parentheses.
Multi-column group:
(column-name, column-name [,column-name]...)
specifies a multi-column group.
To generate multi-column statistics, group a set of columns within parentheses, as
shown. You cannot specify the name of a column more than once in the same group
of columns.
One histogram is generated for each unique column group. Duplicate groups, meaning
any permutation of the same group of columns, are ignored and processing continues.
When you run UPDATE STATISTICS again for the same user table, the new data for that
table replaces the data previously generated and stored in the table's histogram tables.
Histograms of column groups not specified in the ON clause remain unchanged in
histogram tables.
For more information about specifying columns, see
for Columns" (page
EVERY COLUMN
The EVERY COLUMN keyword indicates that histogram statistics are to be generated
for each individual column of table and any multicolumns that make up the primary
key and indexes. For example, table has columns A, B, C, D defined, where A, B, C
compose the primary key. In this case, the ON EVERY COLUMN option generates a
single column histogram for columns A, B, C, D, and two multi-column histograms of
(A, B, C) and (A, B).
The EVERY COLUMN option does what EVERY KEY does, with additional statistics on
the individual columns.
242).
208).
"Using Statistics" (page
"Generating and Clearing Statistics
UPDATE STATISTICS Statement
207).
205

Advertisement

Table of Contents
loading

Table of Contents