Example: Statistics Are Not Copied If an OLAP Operation Is Specified in the Subquery - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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;