Archives of the TeradataForum
Message Posted: Tue, 16 Dec 2003 @ 11:36:41 GMT
| Subj: || || Re: How much statistics to collect |
| From: || || Dieter Noeth |
David Clough wrote:
| ||This news concerns me somewhat, as one school of thought in our shop (please excuse the mixed metaphor) is that for low cardinality
columns - where there are no Statistics at all on the column - Dynamic Random Amp Sampling ('DRAS') would produce an adequate Explain
| ||Having tried an example, however, I can certainly confirm that Martin is indeed correct and found that Teradata would appear to take
the cardinality of the Primary Index as its basis for arriving at the (no confidence) Explain estimate.|| |
| ||My example was based on pretty small tables, but I assume the principle would extend to larger ones.|| |
| ||Can anyone shed any light on the situations in which 'DRAS' would come into play (ooh, another mixed metaphor) ?|| |
It's only done with indexes, primary or secondary, as it calculates the number of rows by reading one cylinder index without
accessing any datablocks. If you try a query on a col without statstics using "where col = xyz", you'll see a "estimated with no
confidence" without index and "estimated with low confidence" with index.
The same for "sel col from tab group by col", but not for "sel distinct col"?