All Forums Database
rakuje 1 post Joined 03/06
10 Mar 2006
Table sizing in bytes

Hello Experts,Could someone tell me how I could calculate the table size of a teradata table in bytes?Appreciate your help!Regards,jerk

GreatSushant 12 posts Joined 05/05
12 Mar 2006

Formula(BlockSize -38_/RowSize = RowsPerBloclRowCount /RowsPerBlock = BolcksNumAmps *1024 = Header(Blocks * BlockSize )+ Header = Nofallback(Blocks * BlockSize )*2 + Header = fallbackParameters38 =Block Header + Block Trailer1024 = Typical table header sizeBlockSize = Typical block size in bytesNumAmps = Number of amps in the systemRowCount = Number of table rows expectedRowSize = Physial row size

Jim Chapman 449 posts Joined 09/04
13 Mar 2006

For an existing, populated table, you can query DBC.TableSize.Example:Select sum(currentperm) from dbc.tablesize where databasename = 'mydbname' and tablename = 'mytablename';

williamdieter 15 posts Joined 03/06
21 Mar 2006

Something that might give you a bit more information.-- Tables and their size Selecttbl.DatabaseName,tbl.TableName,tbl.CreatorName as Creator,sum(tsize.currentperm) asPermSize,max(tsize.currentperm)/avg(tsize.currentperm) (decimal (18,2)) (named SkewRatio),max(tsize.currentperm) (named BytesUsedTopAmp)from dbc.tables tblinner joindbc.tablesize tsizeONtbl.Tablename = tsize.Tablenameand tbl.Databasename = tsize.Databasenameand tbl.Tablekind = 'T'where--tbl.databasename in ('mydatabase') --All tables in these databases--and cast(tbl.createtimestamp as date) >= date -- Tables created after a specific date--tbl.tablename in ('mytable') -- A specific tabletbl.creatorname = user --Your tablesgroup by 1,2,3order by 4 desc;

You must sign in to leave a comment.