HP Neoview SQL Reference Manual page 176

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

column-list | EVERY COLUMN [, column-list] | EVERY KEY [, column-list] |
EXISTING COLUMN[S] [, column-list]
specifies the ways in which 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)
are the ways you can specify individual columns or a group of individual columns.
To generate statistics for individual columns, list each column. You have the option
of listing 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.
EVERY KEY
The EVERY KEY keyword indicates that histogram statistics are to be generated for
columns that make up the primary key and indexes. For example, table has columns
A, B, C, D defined. If the primary key comprises columns A, B, statistics are generated
for (A, B), A and B. If the primary key comprises columns A, B, C, statistics are generated
for (A,B,C), (A,B), A, B, C. If the primary key comprises columns A, B, C, D, statistics are
generated for (A, B, C, D), (A, B, C), (A, B), and A, B, C, D.
EXISTING COLUMN[S]
The EXISTING COLUMN keyword indicates that all existing histograms of the table are
to be updated.
histogram-option
GENERATE n INTERVALS
The GENERATE n INTERVALS option for UPDATE STATISTICS now accepts values
between 1 and 10,000. Keep in mind that increasing the number of intervals per
histograms may have a negative impact on compile time.
Increasing the number of intervals is recommended for columns with small set of
possible values and large variance of the frequency of these values. For example,
176
SQL Statements
178).
"Generating and Clearing Statistics

Advertisement

Table of Contents
loading

Table of Contents