Re: Reducing data type space usage

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Gregory Stark <stark(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reducing data type space usage
Date: 2006-09-16 15:18:10
Message-ID: 450C15B2.1040608@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> To review: Bruce is
> proposing a var-length type structure with the properties
>
> first byte 0xxxxxxx ---- field length 1 byte, exactly that value
> first byte 1xxxxxxx ---- xxxxxxx data bytes follow
>
> This can support *any* stored value from zero to 127 bytes long.
> We can imagine creating new datatypes "short varchar" and "short char",
> and then having the parser silently substitute these types for varchar(N)
> or char(N) whenever N <= 127 / max_encoding_length. Add some
> appropriate implicit casts to convert these to the normal varlena types
> for computation, and away you go. No breakage of any existing
> datatype-specific code, just a few additions in places like
> heap_form_tuple.
>
>
>

I like this scheme a lot - maximum bang for buck.

Is there any chance we can do it transparently, without exposing new
types? It is in effect an implementation detail ISTM, and ideally the
user would not need to have any knowledge of it.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-09-16 15:38:46 Re: Reducing data type space usage
Previous Message Hannu Krosing 2006-09-16 14:16:01 Re: Reducing data type space usage