470,590 Members | 2,371 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,590 developers. It's quick & easy.

finding out actual tuple size

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??

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..

if someone knows how please shine some light on my situation..

thanks

--------------------------------
Linh Luong
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 22 '05 #1
3 2919
On Tue, Feb 17, 2004 at 03:39:25PM -0700, Linh Luong wrote:
Hi All,

1. I have been reading and the max size of a tuple is 8K.


That hasn't been true for ages. Use a newer PostgreSQL; any modern
one will have the TOAST capability and won't have this limitation.

A

--
Andrew Sullivan

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 22 '05 #2
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.
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 22 '05 #3
Andrew Sullivan <aj*@crankycanuck.ca> writes:
On Tue, Feb 17, 2004 at 03:39:25PM -0700, Linh Luong wrote:
1. I have been reading and the max size of a tuple is 8K.
That hasn't been true for ages. Use a newer PostgreSQL; any modern
one will have the TOAST capability and won't have this limitation.


Actually it is still true, but with TOAST compression available for
individual columns it hardly ever matters anymore. If you have enough
columns in your table to be running afoul of the limit, you probably
oughta be thinking about a redesign of your database schema anyway.

But for the record: BLCKSZ is the thing to poke if you really must.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Carlo v. Dango | last post: by
1 post views Thread by Jinming Xu | last post: by
29 posts views Thread by George Sakkis | last post: by
8 posts views Thread by Tor Inge Rislaa | last post: by
43 posts views Thread by Tim Chase | last post: by
77 posts views Thread by Nick Maclaren | last post: by
2 posts views Thread by fabian.conrad | last post: by
7 posts views Thread by Breal | last post: by
275 posts views Thread by Astley Le Jasper | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.