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

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-242
UPDATE STATISTICS Statement
If you specify the SAMPLE clause without additional options, a row sample
is used to read 2 percent of the rows in the table, with a maximum of 2
million rows. If you specify the ROWCOUNT option, NonStop SQL/MX reads
2 percent of c, with a maximum of 2 million rows.
If you do not specify the SAMPLE clause, table has fewer rows than
specified, or the sample size is greater than the system limit. NonStop
SQL/MX reads all rows from table.
See SAMPLE Clause on page 7-8.
sample-option
[r ROWS]
A row sample is used to read r rows from the table. The value r must be
an integer that is greater than or equal to zero (r > 0).
If you specify the ROWCOUNT clause, r must be less than or equal to c (r <
c). The percentage is determined by the equation r/c * 100.
RANDOM percent PERCENT [CLUSTERS OF blocks BLOCKS]
directs NonStop SQL/MX to choose rows randomly from the table. The
value percent must be a value between zero and 100 (0 < percent <
100). In addition, only the first four digits to the right of the decimal point
are significant. For example, value 0.00001 is considered to be 0.0000,
Value 1.23456 is considered to be 1.2345.
CLUSTERS OF blocks BLOCKS
specifies the number of blocks that compose the cluster. The value
block must be an integer that is greater than or equal to zero
(blocks > 0).
PERIODIC size ROWS EVERY period ROWS
directs NonStop SQL/MX to choose the first size number of rows from
each period of rows. The value size must be an integer that is greater
than zero and less than or equal to the value period. (0 < size <
period). The size of the period is defined by the number of rows specified
for period. The value period must be an integer that is greater than
zero (period > 0).
SET ROWCOUNT c
is an optional clause that specifies the number of rows in the table. The value c
must be an integer that is greater than or equal to zero (c > 0).
If the ROWCOUNT clause in not specified, NonStop SQL/MX determines the
number of rows in the table either by estimation or SELECT COUNT(*).