|
|
Archives of the TeradataForum
Message Posted: Fri, 13 Jan 2012 @ 19:33:50 GMT
Subj: | | Re: Generate collect statistics statement |
|
From: | | DAVID WILLIAMS |
The will give tables without stats:
SEL TRIM(DATABASENAME) || '.' || TRIM(TABLENAME) (TITLE'')
FROM SYSDBA.REFRESH_TABLE_LIST 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
);
| |