How to get the amount of data?

Database
Enthusiast

How to get the amount of data?

Hi,

Is there a way to find the amount of data present in a partition in teradata?
1 REPLY
Junior Contributor

Re: How to get the amount of data?

You can only get the row count per partition and calculate a percentage based on that,

untested:

select partition, cnt,
tabsize * cnt / sum(cnt) over ()
from
(
select partition, count(*) as cnt
from mytab
) as p_count
cross join
(
select sum(currentperm) as tabsize
from tablesize
where databasename = 'mydb' and tablename = 'mytab'
) as dt

Dieter