Re: Alternative variable length structure

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: ITAGAKI Takahiro <itagaki(dot)takahiro(at)lab(dot)ntt(dot)co(dot)jp>
Subject: Re: Alternative variable length structure
Date: 2005-09-08 16:53:51
Message-ID: 200509080953.52194.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Takahiro,

> PostgreSQL can treat variable-length data flexibly, but therefore
> it consumes more spaces if we store short data. Headers of
> variable-length types use 4 bytes regardless of the data length.
>
> My idea is to change the header itself to variable-length.
> In order to reduce the size of short data, I wrote a patch to encode
> lengths into the first several bits of structure. Also, the alignments
> of the types were changed to 'char' from 'int'.
>
> I know my patch is still insufficient, for example, the types cannot
> be TOASTed. But I guess this compression works well for short text.

Hmmm. Seems like these would be different data types from the standard ones
we deal with. I can see the value for data warehousing, for example.

Wouldn't this require creating, for example, a SHORTTEXT type? Or were you
planning this to handle VARCHAR(6) and the like? If so, how would we deal
with users who change the length via ALTER TABLE?

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2005-09-08 17:01:06 Re: initdb profiles
Previous Message Tom Lane 2005-09-08 16:50:46 Re: pgsql: Update timezone data files to release 2005m of the zic database