SQL/MX 3.2.1 Reference Manual (H06.26+, J06.15+)

SQL/MX Statements
HP NonStop SQL/MX Release 3.2.1 Reference Manual691117-005
2-411
UPGRADE Utility
This example selectively removes histograms for column STREET in table
ADDRESS:
UPDATE STATISTICS FOR TABLE address ON street CLEAR;
This example generates statistics for a sample from table MAILINGS. The sample
size is 7.3529 percent and the number of rows in the table is 272,000. The records
that are selected by sampling are stored in a temporary table, which is partitioned
the same way as MAILINGS. The data in the temporary table is then used to
generate the statistics.
UPDATE STATISITCS FOR TABLE MAILINGS
ON EVERY COLUMN
SAMPLE RANDOM 7.3529 PERCENT CLUSTERS OF 1 BLOCKS
SET ROWCOUNT 272000
USING SAMPLE TABLE WITH PARTITIONS;
This example generates statistics for a sample from table MAILINGS. The sample
size is 7.3529 percent and the number of rows in the table is 272,000. The records
that are selected by sampling are stored in a temporary table,
MY_SAMPLE_TABLE, which is specified by the user. The data in the temporary
table is then used to generate the statistics.
UPDATE STATISITCS FOR TABLE MAILINGS
ON EVERY COLUMN
SAMPLE RANDOM 7.3529 PERCENT CLUSTERS OF 1 BLOCKS
SET ROWCOUNT 272000
USING SAMPLE TABLE MY_SAMPLE_TABLE;
For additional examples, see the SQL/MX Query Guide.
UPGRADE Utility
Considerations for UPGRADE
Example of UPGRADE
UPGRADE is a syntax-based utility command that can be executed from MXCI.
UPGRADE transforms metadata from the existing version to the current schema
version for the SQL/MX Software Version (MXV). The REPORTONLY option allows you
to test if the operation can be executed without actually performing the operation.
UPGRADE ALL METADATA
[ output-spec ]
UPGRADE ALL METADATA IN CATALOG catalog
[ RESTRICT | CASCADE ]
[ output-spec ]
output-spec is:
[ log-to-spec ] [ REPORTONLY ]
log-to-spec is:
{ [ LOG TO ] OUTFILE oss-file [ CLEAR ] | LOG TO HOMETERM }