cancel
Showing results for 
Search instead for 
Did you mean: 

7.5.0.38: how to retrieve size of tables

Former Member
0 Kudos

Hello,

we're using "plain"(==only MaxDB, without any SAP on top) MaxDB 7.5.0.38 on linux and we wanted to know how we can determine the size of a table (how much disk space a table uses).

Is this possible, and if yes, how ?

thanks in advance...GERD...

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

> we're using "plain"(==only MaxDB, without any SAP on top) MaxDB 7.5.0.38 on linux and we wanted to know how we can determine the size of a table (how much disk space a table uses).

>

> Is this possible, and if yes, how ?

That's pretty easy - just make sure that the optimizer statistics are current.

Then you can run the following statement


select owner, tablename, distinctvalues, pagecount, pagecount*8 size_KB 
from optimizerstatistics 
where columnname ='TABLE STATISTICS'

BUT: this one is just to see table sizes (no indexes!) and it does NOT cover LONG/LOB columns.

If you want to cover these as well, you need to query TABLESTATISTICS and INDEXSTATISTICS.

But be VERY carefull with these tables, as they perform a full scan of the table you want to query the data for at the moment when you run the query.

So if the table is rather large, you will create lots of I/O.

regards,

Lars

Former Member
0 Kudos

Hi Lars,

thanks for your quick solution....

regards..GERD..

Answers (0)