Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 16 Dec 2003 @ 09:21:56 GMT


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


Subj:   Re: How much statistics to collect
 
From:   Martin O Brien

In our place we have a standard that you collect stats on all primary indices , on all joining columns and columns which appear in the where clause.

It can actually be more important to collect stats on a column which has only 2 values. If Teradata does not have stats on that column then it uses default statistics ( if stats have been collected on any other column/index of the table) . The default statistics are going to assume a lot more than two distinct values. This implies that if that column is used as a predicate and there are no stats on this column , Teradata is going to assume that a lot fewer rows are going to qualify as a result of the predicate. This could cause bad access paths.

One possibility in your below query is that on that join to another table the qualifying rows duplicate across all amps rather than redistribute as Teradata assumes a lot less rows will qualify for the join. This could result in spool issues if it is then duplicating most of the table across all amps.



     
  <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