You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by S <s....@gmail.com> on 2006/11/01 07:00:11 UTC

storage estimation

Hi, how do I estimate the average record length of a table. Actually, I have
a fast growing table and I need to understand the disk size requirement of
it. In Oracle, the all_tables table provides this information.

Re: storage estimation

Posted by Stanley Bradbury <St...@gmail.com>.
S wrote:
> Hi, how do I estimate the average record length of a table. Actually, 
> I have a fast growing table and I need to understand the disk size 
> requirement of it. In Oracle, the all_tables table provides this 
> information.
I couldn't find this in the documentation but it still works - no 
promises that it will not be removed at some point - the following shows 
the space (pages and pagesize) for the tables and indexes of a table.  
Average records size can be computed by summing all the sizes (pages x 
pagesize), divide by the rows in the table.

 select * from NEW org.apache.derby.diag.SpaceTable('SYS','SYSTABLES') AS x;

CONGLOMERATENAME
        |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        
|NUMUNFILLEDPAGES    |PAGESIZE   |ESTIMSPACESAVING
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
SYSTABLES_INDEX1
        |1     |1                   |0                   
|1                   |4096       |0
SYSTABLES_INDEX2
        |1     |1                   |0                   
|1                   |4096       |0
SYSTABLES
        |0     |1                   |0                   
|1                   |4096       |0