|
|
Archives of the TeradataForum
Message Posted: Tue, 13 Dec 2011 @ 07:48:02 GMT
Subj: | | Re: Tables which don't have stats |
|
From: | | Gupta, Vipin |
Hi Sarvan,
I believe following query can be used to determine tables which don't have any stats collected:
sel trim(d.databasename)||'.'||trim(t.tvmname) (title'table') from dbc.tvm t, dbc.dbase d
where t.databaseid = d.databaseid and t.tablekind ='T'
MINUS
(
sel trim(d.databasename)||'.'||trim(t.tvmname)
from dbc.indexes i, dbc.tvm t, dbc.dbase d where i.indexstatistics is not null and
i.tableid = t.tvmid and i.databaseid = d.databaseid and t.tablekind ='T'
union
sel trim(d.databasename)||'.'||trim(t.tvmname)
from dbc.tvfields f, dbc.tvm t, dbc.dbase d where f.fieldstatistics is not null and
f.tableid = t.tvmid and f.databaseid = d.databaseid and t.tablekind ='T'
) order by 1
;
Thanks,
Vipin Gupta
| |