DROP STATISTICS Examples | SQL Statements | Teradata Vantage - DROP STATISTICS Examples - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qtb1554762060450.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

Example: Drop Statistics on All Columns

The following example drops statistics on all columns and indexes for the orders table from the TableStatistics table of the QCD database named MyQCD.

     DROP STATISTICS FROM MyQCD
     ON orders;

Example: Drop Statistics on a Single Column

The following example drops statistics on a single-column NUSI named orderDateNUPI from the TableStatistics table of the QCD database named MyQCD.

     DROP STATISTICS FROM MyQCD
     ON orders INDEX orderDateNUPI; 

Example: Dropping PARTITION Statistics

The following DROP STATISTICS request drops statistics on the PARTITION column only for the table named table_1 from the TableStatistics table in the QCD named QCD_11:

     DROP STATISTICS FROM QCD_11 ON table_1
     COLUMN PARTITION;

The following DROP STATISTICS request drops statistics on the column named column_1 and the system-derived PARTITION column for the table named table_2 from the TableStatistics table in the QCD named QCD_12:

     DROP STATISTICS FROM QCD_12 ON table_2
     COLUMN (column_1, PARTITION);

The following table-level DROP STATISTICS request drops all the statistics, including statistics on the system-derived PARTITION column, for the table named table_3 from the TableStatistics table in the QCD named QCD_13:

     DROP STATISTICS FROM QCD_13 ON table_3;