15.10 - UpdateStatHistogramSettings - Teradata Database

Teradata Database Application Programming Reference

prodname
Teradata Database
vrm_release
15.10
category
Programming Reference
featnum
B035-1090-151K

Records the user specified MAXINTERVAL or MAXVALUELENGTH setting to include when preparing and executing the SQL COLLECT STATISTICS statements on selected statistics or objects.

REPLACE PROCEDURE TDSTATS.UpdateStatHistogramSettings
 (IN SCOID BIGINT,
  IN DatabaseName        VARCHAR(128) CHARACTER SET UNICODE,
  IN TableName           VARCHAR(128) CHARACTER SET UNICODE,
  IN MaxIntervals        INTEGER,
  IN MaxValueLength      INTEGER,
  OUT NumUpdated         INTEGER)
           .
           .
           .
;
 

Parameter

Description

SCOID

TDSTATS ID of an individual statistic whose histogram settings are to be changed.

DatabaseName

Name of the database. DatabaseName limits the new settings applied to all statistics collected within the database you specify.

TableName

Name of the table within the specified DatabaseName. TableName limits the new settings to statistics collected on the table you specify within DatabaseName.

MaxIntervals

Maximum number of histogram intervals used for collected statistics.

A value of -1 indicates the SYSTEM selected value is used. For more information, see the COLLECT STATISTICS MAXINTERVALS option in SQL Data Definition Language.

MaxValueLength

Maximum size for histogram values.

A value of -1 indicates the SYSTEM selected value is used. For information on the valid range of values, see the COLLECT STATISTICS MAXVALUELENGTH option in SQL Data Definition Language.

The new collection settings will take effect during the next RunCollect operation involving the selected statistics. For more information, see “RunCollect” on page 550.

Updating Statistics

 

To update ...

You must specify a value for ...

a single statistics collection

SCOID.

Note: This input parameter cannot be NULL.

all statistics for a specified database

DatabaseName.

Note: This input parameter cannot be NULL.

all statistics for a specified table

both DatabaseName and TableName.

 

Parameter

Description

NumUpdated

Number of statistics whose histogram settings have been updated.

The following example shows how to specify a MAXINTERVALS value of 500 when collecting statistics on the individual statistic whose TDSTATS database ID is 102.

CALL TDSTATS.UpdateStatHistogramSettings(102, 'Personnel', 'Employee', 500, 0, NumUpdated);
 
*** Procedure has been executed. 
*** Total elapsed time was 1 second.
 
 NumUpdated
-----------
          1