Monday, February 8, 2016

Netezza: how TEMP tables GENERATE STATISTICS when created as CTAS

This runtime illustration how Netezza generates full table statistics automatically during CREATE TABLE AS (CTAS) operation. Running nz_responders yields output: 




Read more how Netezza generates statistics on tables in  Maintain table statistics automatically

The IBM® Netezza® system automatically maintains database statistics and estimated dispersion statistics, which are not as accurate as the statistics that the system maintains when you run the GENERATE STATISTICS command. These statistics are, however, generally better than no statistics.
The Netezza system maintains certain statistics when you perform database operations.
  • When you use the CREATE TABLE AS command, the system maintains the min/max, null, and estimated dispersion values automatically.
  • When you use the INSERT or UPDATE commands, the system maintains the min/max values for all non-character fields.
  • When you use the GROOM TABLE command to reclaim deleted records, the system leaves the min/max, null, and estimated dispersion values unchanged, and updates the zone map.
    Because the groom process merely physically removes records that were logically deleted, their removal has no effect on any statistics, though it does affect where in the table the remaining records are, hence the effect on zone maps.
The following table describes when the Netezza automatically maintains table statistics.
Table 1. Automatic Statistics
CommandRow countsMin/MaxNullDispersion (estimated)Zone maps
CREATE TABLE ASyesyesyesyesyes
INSERTyesyesnonoyes
DELETEnonononono
UPDATEyesyesnonoyes
GROOM TABLEnonononoyes
Parent topic: Database statistics




No comments:

Post a Comment