Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 17 Dec 2003 @ 17:01:01 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: How much statistics to collect
 
From:   Walter, Todd A

If no stats and no index on a column then OPT uses the total cardinality of the table (from PI stats or random sample) and a set of constants for the selectivity based on the type of expression (equality assumes 20%, open ended inequality 90%,...).

The farther your data demographics are in either direction from the default estimates, the more important it is to collect stats on that column. In this case, equality on the column assumes 20% selectivity while the reality is 50% or more, a large difference that is likely to affect plans. And many times these "flag" type columns are not even themselves - 4 values might be represented 90%, 7%, 2%, 1% so it would be even more critical to collect stats so the optimizer can see the skew.

This is where I start (in priority order):

Indexes (except UPI of large tables)

PIs of small tables (<1000 rows per AMP)

Equality and range where condition references

Join columns

other where condition references

skewed columns in general get higher priority among equals



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023