Re: Fixed length data types issue - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Fixed length data types issue
Date
Msg-id 200609081855.k88ItCM05797@momjian.us
Whole thread Raw
In response to Re: Fixed length data types issue  (Gregory Stark <gsstark@mit.edu>)
Responses Re: Fixed length data types issue  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Fixed length data types issue  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Gregory Stark wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> 
> > Gregory Stark wrote:
> > > But I think this is a dead-end route. What you're looking at is the number "1"
> > > repeated for *every* record in the table. And what your proposing amounts to
> > > noticing that the number "4" fits in a byte and doesn't need a whole word to
> > > store it. Well sure, but you don't even need a byte if it's going to be the
> > > same for every record in the table.
> > > 
> > > If someone popped up on the list asking about whether Postgres compressed
> > > their data efficiently if they stored a column that was identical throughout
> > > the whole table you would tell them to normalize their data.
> > 
> > I am confused.  You don't want to shrink the header but instead compress
> > duplicate values in the same row to a single entry?
> 
> I think we have to find a way to remove the varlena length header entirely for
> fixed length data types since it's going to be the same for every single
> record in the table.

What fixed-length data type has a header?

> It might be useful to find a way to have 1-byte or 2-byte length headers too
> since I suspect most legitimately variable columns like text or array[] are
> also gong to be under 256 bytes.

I think the point you are making is that fixed length fields, like GUID,
don't need a header, while short fields like VARCHAR() and NUMERIC()
need some shorter header.

No one has mentioned that we page value on disk to match the CPU
alignment.  This is done for efficiency, but is not strictly required.

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Query returning tuples that does not satisfy the WHERE clause
Next
From: Tom Lane
Date:
Subject: Re: Fixed length data types issue