db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Segel" <mse...@mycingular.blackberry.net>
Subject Re: table size estimation
Date Fri, 03 Nov 2006 17:07:35 GMT
Just a hunch...
Some of your fields will get rounded up to the nearest word size. 
Assume word size to be 8 bytes.

So you would have 
5*8 for your big ints 
3*8 for your small ints
14 rounded to nearest word size = 24
Plus 16 bytes for the pointer to the rest of the varchar.
And 16 for the time stamp

That would give you 130 bytes.

But hey whatdo I know? I'm just shooting from the hip on my crackberry.

Sent via BlackBerry.

-Mike Segel
312 952 8175

-----Original Message-----
From: S <s.mailinglists@gmail.com>
Date: Fri, 3 Nov 2006 03:01:29 
Subject: table size estimation

This is a follow up email to my earlier posting regarding storage. Based on the query given,

select * from NEW org.apache.derby.diag.SpaceTable('SYS','SYSTABLES') AS x;
using it for my table, the estimated size of a record is coming to be 131 bytes. The table
consists of 5 bigints, 3 smallints, 1 timestamp and a varchar. The avg length of the varchar
is 14chars. So, total size of the record size should have been 5*8+3*2+14+(bytes for timestamp)+any
additional per field/record data all put together shouldn't be more than 70/80 bytes. So,
why am I getting 131 bytes? 
View raw message