I have a table in Teradata. I would like to know its size. The same thing might be interesting for databases in Teradata.
How can I do it?
Procedure. Perform the following procedure to complete the Row Size Calculation form for each table. Identify each column in the table and enter its name in the Column Name column. Identify the data type for each column and enter it in the Type column next to the column name.
Skewness is the statistical term, which refers to the row distribution on AMPs. If the data is highly skewed, it means some AMPs are having more rows and some very less i.e. data is not properly/evenly distributed. This affects the performance/Teradata's parallelism.
To check your table size you can check from dbc.tablesize
. check the below query.
SELECT
A.DatabaseName
,A.tablename
,CreateTimeStamp
,CAST(SUM(CURRENTPERM) AS DECIMAL(18,2))/(1024*1024*1024) (TITLE 'Used(GB)')
FROM dbc.tablesize A,DBC.TABLES B
WHERE A.TABLENAME=B.TABLENAME
AND A.DatabaseName = B.DatabaseName
AND A.DatabaseName = 'your database name/schemaname/appname'
AND A.tablename = 'your tablename'
GROUP BY 1,2,3 ORDER BY 3 DESC;
To check data base size you can use dbc.diskspace
, the query will be something like this:
SELECT
DatabaseName
,CAST(SUM(CurrentPerm) AS DECIMAL(18,5))/(1024*1024*1024) (TITLE 'Used(GB)')
,CAST(SUM(MaxPerm) AS DECIMAL(18,5))/(1024*1024*1024) (TITLE 'Allocated(GB)')
,CAST(SUM(MaxPerm)-SUM(CurrentPerm) AS DECIMAL(18,5))/(1024*1024*1024) (TITLE 'Free(GB)')
FROM DBC.DiskSpace
WHERE DatabaseName = 'databasename'
GROUP BY 1
ORDER BY 2 Desc;
This will give you used space, allocated space and free space available in your database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With