Teradata – Most Currently Updated Stats

This is a quick query that I use to check if the on the stats job that ran over night.  Much faster then running the “SHOW STATISTICS” for each table.

select 
DatabaseName, 
TableName, 
ColumnName, 
RowCount, 
LastCollectTimeStamp AT 'America Eastern' AS LastCollectTimeStamp, 
SampleSizePct
from DBC.TableStatsV
where LastCollectTimeStamp > DATE - 1
AND DatabaseName not in ('DBC')
order by LastCollectTimeStamp;
Stats that were last ran

Works in Teradata Express too.

Leave a Comment