Quantcast
Channel: Teradata Developer Exchange - Blog activity for carrie's blog
Viewing all articles
Browse latest Browse all 1058

New opportunities for statistics collection in Teradata 14.0 - comment by carrie

$
0
0

Hi Mark,
 
The optimizer will ATTEMPT to collect multiple stats in one pass of the table when you use the coding below, but often it decides there is no cost savings in doing so and will revert to individual table scans/aggregations.  The cases where it tends to bundle up multiple collections in a single table scan are when there are collections on multicolumn stats as well as collections on the component columns that make up the mutlicolumn stat.  The other cases where the optimizer frequently bundles up collections is when the columns have a low number of distinct values. 
 
The optimizer has to be able to re-use the spool file it creates in the single pass to make the bundling a viable choice.  For that reason, columns with higher numbers of distinct values that have no relationship one to another almost always involve their own full table scan.  
 
It works the same whether you are using the syntax below or recollecting at the table level.  If the optimizer can detect a benefit in bundling multiple collect statements within a table,  or a subset of them, it will.  Otherwise it won't.
 
Thanks, -Carrie
 


Viewing all articles
Browse latest Browse all 1058

Latest Images

Trending Articles



Latest Images