Archives of the TeradataForum
Message Posted: Tue, 16 Dec 2003 @ 09:21:56 GMT
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.
|