Re: finding out actual tuple size - Mailing list pgsql-general

From scott.marlowe
Subject Re: finding out actual tuple size
Date
Msg-id Pine.LNX.4.33.0402201522360.12602-100000@css120.ihs.com
Whole thread Raw
In response to finding out actual tuple size  (Linh Luong <linh.luong@shaw.ca>)
List pgsql-general
On Tue, 17 Feb 2004, Linh Luong wrote:

> Hi All,
>
> 1. I have been reading and the max size of a tuple is 8K.
> I have also read that I can it to a larger size in some config file.  Where is
> this file? is it called pg_config.h and is the variable called BLKSZ??

You'd have to set the way back machine for a couple years ago to run into
the 8k block size limit.  If someone recently told you this to steer you
away from Postgresql their knowledge is quite old, and anything they tell
you about anything since, say, the first gulf war should be viewed with
suspicion :-)

the maximum size of an idividual FIELD in a row is about 2 gigabytes.
Since text may be multi-byte, it's a good idea to call it 1 gig (of
characters) for text and you're gold.

> 2. Is there a way I can find the actual size of the tuple? Do you go into each
> column and find the length of each value and sum it up? I am out of ideas..

Why would you need to know an idividual tuple size?  There's a bit of
extra data for each field, but generally if the size of the data in the
field is 1k or more, you're not likely to notice the overhead Postgresql
is producing.

Each tuple uses about 30 some bytes, (I could be way off there, it might
be bits.)  then each field uses another byte or two to keep track of
things like the size of the field etc on top of the actual data it stores.


pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Re: Problems with plpgsql and FOR loops
Next
From: Bill Moran
Date:
Subject: Re: Problems with plpgsql and FOR loops