|
|
Archives of the TeradataForum
Message Posted: Wed, 14 Dec 2011 @ 15:38:17 GMT
Subj: | | Re: Tables which don't have stats |
|
From: | | DAVID WILLIAMS |
Sorry there was a mistake in the last version:
SEL TRIM(DATABASENAME) || '.' || TRIM(TABLENAME) (TITLE'') FROM DBC.TABLES A WHERE NOT
EXISTS
( SEL DATABASENAME, TABLENAME
FROM
(SEL DATABASENAME,
TABLENAME
FROM DBC.COLUMNSTATS
WHERE FIELDSTATISTICS IS NOT NULL
GROUP BY 1,2
UNION
SEL DATABASENAME,
TABLENAME
FROM DBC.MULTICOLUMNSTATS
WHERE COLUMNSSTATISTICS IS NOT NULL
GROUP BY 1,2
UNION
SEL DATABASENAME,
TABLENAME
FROM DBC.INDEXSTATS
WHERE INDEXSTATISTICS IS NOT NULL
GROUP BY 1,2) B
WHERE A.DATABASENAME = B.DATABASENAME
AND A.TABLENAME = B.TABLENAME);
| |