NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
U-7
UPDATE STATISTICS Statement
You must also update the DEPT table to change the MANAGER column to the
employee's new number. To ensure that all of your changes take place (or that none
of them do), you should perform the operation as a TMF transaction, as shown:
>> VOLUME $VOL.PERSNL;
>> BEGIN WORK;
>> DELETE FROM EMPLOYEE WHERE EMPNUM = 23;
--- 1 row(s) deleted.
>> INSERT INTO EMPLOYEE
+> VALUES (50, "JERRY", "HOWARD", 1000, 100, 137000.10);
--- 1 row(s) inserted.
>> UPDATE DEPT SET MANAGER = 50 WHERE DEPTNUM = 1000;
--- 1 row(s) updated.
>> COMMIT WORK;
UPDATE STATISTICS Statement
UPDATE STATISTICS is a DDL statement that updates the statistics stored in the
catalog for the specified table. SQL does not automatically update statistics; you must
execute this statement to have current statistics in your catalog.
ALL
requests updated statistics for all columns in the table.
If you do not specify ALL, statistics are updated only for columns that make up the
primary or clustering key of the table and columns specified in any index on the
table.
table
is the name of the table for which to update statistics.
UPDATE [ ALL ] STATISTICS FOR TABLE table
[ RECOMPILE ] [ SIMPLE ] [ EXACT ]
[ NO RECOMPILE ] [ PROBABALISTIC ] [ SAMPLE n BLOCKS ]