Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 31 May 2012 @ 13:16:25 GMT


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


Subj:   Re: Why incorrect stats are worse than not collecting stats?
 
From:   Barrow, Martin

Using an example of an empty table, stats are collected on the empty table, then 10 million rows are added to the table but the stats are not refreshed.

When a query runs to join against the table the stats show it as empty (though this would show as the minimum estimated rows of 1), so the optimiser treats it as such. It is likely that the optimiser would distribute the table to all amps and do a product join as it thinks it is empty. However it has 10 million rows = 10 million x number of AMPs into spool.

In this case refreshing the stats after population would help the optimiser understand the data distribution and the fact it is no longer empty. Stats no longer stale.

Taking the stale stats are worse than no stats, if no stats where on the table, then it would do a random amp sample (dynamic sampling) and would get a better picture of the table than the stats on the table that are stale (the stale stats being those showing empty table).


Regards,

Martin



     
  <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