Re: [HACKERS] varchar(), text,char() overhead - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] varchar(), text,char() overhead
Date
Msg-id 199801212338.SAA18216@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] varchar(), text,char() overhead  (darrenk@insightdist.com (Darren King))
Responses Re: [HACKERS] varchar(), text,char() overhead  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
> > macros too.
>
> Would be a nice space-saver if you have tables with many small text fields.
>
> Dig out that old message of mine concerning block size and check out item #4.
>
> Excerpted below if you've finally deleted it... :) :)
>
> > Date: Wed, 29 Jan 1997 13:38:10 -0500
> > From: aixssd!darrenk (Darren King)
> > Subject: [HACKERS] Max size of data types and tuples.
> > ...
> > 4.  Since only 13 bits are needed for storing the size of these
> > textual fields in a tuple, could PostgreSql use a 16-bit int to
> > store it?  Currently, the size is padded to four bytes in the
> > tuple and this eats space if you have many textual fields.
> > Without further digging, I'm assuming that the size is double-word
> > aligned so that the actual text starts on a double-word boundary.
> > ...

I had forgotten about your mention of this.  I am running some tests
now, and things look promising.  However, if we go to 64k or 128k
tuples, we would be in trouble.  (We can do 64k tuples by changing the
'special variable' length value from -1 to 0.


--
Bruce Momjian
maillist@candle.pha.pa.us

pgsql-hackers by date:

Previous
From: darrenk@insightdist.com (Darren King)
Date:
Subject: Re: [HACKERS] varchar(), text,char() overhead
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] varchar(), text,char() overhead