Example: Statistics Are Not Copied If An OLAP Operation Is Specified in The Subquery - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

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

Vantage does not copy statistics if an OLAP function is specified in the subquery as the examples in this set demonstrate.

Example1

In this example, Vantage does not copy statistics because of the OLAP RANK function in the subquery.

    CREATE TABLE t3 (c1, c2, c3) AS (SELECT x, RANK(y), z
                                     FROM test 
                                     QUALIFY RANK(X)> 1) 
    WITH DATA AND STATISTICS;

Example2

In this example, Vantage does not copy statistics because of the partial data returned by the SAMPLE operator.

    CREATE TABLE t3 (c1, c2, c3) AS (SELECT x, y, z
                                     FROM test SAMPLE 4) 
    WITH DATA AND STATISTICS;