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

From Gregory Stark
Subject Re: Fixed length data types issue
Date
Msg-id 87u03jxu5s.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Fixed length data types issue  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Fixed length data types issue  (Bruce Momjian <bruce@momjian.us>)
Re: Fixed length data types issue  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:

> I think it would be good to see if we can extend the varlena data types
> to support a shorter header for storing short byte values.  Looking at
> the header now we have:

This isn't the first time we've been down that route. There were some
extensive discussions a while back. I think there were even patches.
I don't remember why it was eventually rejected. I suspect it simply got too
complex.

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.

-- 
greg



pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Fixed length data types issue
Next
From: Tom Lane
Date:
Subject: log_duration is redundant, no?