On 9/8/05 9:53 AM, "Josh Berkus" <josh@agliodbs.com> wrote:
> 
> 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?


If I am reading the patch correctly (and I may not be), changing the length
via ALTER TABLE would not affect anything because the header length is
variable per type instance in the table.  This appears to be an alternate
encoding for VARCHAR(n) and similar.

This is not dissimilar to how ASN.1 BER prefix encodes type lengths, an
encoding widely used in wire protocols.  This can save quite a few bytes in
many cases, particularly when storing short byte strings (for ASN.1, even
integers and similar are encoded this way to shave bytes on them as well but
that seems excessive).  It would be useful to see how encoding/decoding cost
balances out the more compact representation in terms of performance.


J. Andrew Rogers



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to