 |
 |
Archives of the TeradataForum
Message Posted: Wed, 05 Jan 2011 @ 16:42:52 GMT
Subj: | | Re: Copying Statistics from one table to another |
|
From: | | Joe Gleason |
This will give you most of the stats you are looking for:
sel 'collect stats on ' || trim(c.databasenamei) || '.' ||
trim(b.tvmnamei) || ' column ' || trim(a.fieldname) || ';'
from
dbc.tvfields a,
dbc.tvm b,
dbc.dbase c
where a.tableid = b.tvmid
and b.tablekind = 'T'
and b.databaseid = c.databaseid
and upper(trim(c.databasenamei)) in ('dbname')
and a.fieldstatistics is not null
order by c.databasename,b.tvmname,a.fieldname
| |