Re: Range types

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: decibel <decibel(at)decibel(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Greg Stark <gsstark(at)mit(dot)edu>, tomas(at)tuxteam(dot)de, Scott Bailey <artacus(at)comcast(dot)net>, hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Range types
Date: 2009-12-16 00:29:26
Message-ID: 1260923366.13414.2190.camel@monkey-cat.sm.truviso.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2009-12-15 at 18:06 -0600, decibel wrote:
> Now that varlena's don't have an enormous fixed overhead, perhaps it's
> worth looking at using them. Obviously some operations would be
> slower, but for your stated examples of auditing and history, I
> suspect that you're not going to notice the overhead that much.

For most varvarlena types, you only get stuck with the full alignment
burden if you get unlucky. In this case, we're moving from 16 bytes to
17, which really means 24 bytes with alignment. Try creating two tables:

create table foo(i int8, t1 timestamp, t2 timestamp);
create table bar(i int8, c "char", t1 timestamp, t2 timestamp);

That extra byte there costs you 8 bytes, every time (on my machine,
anyway).

We're at serious risk of people saying "Ah, this temporal thing is
bloated. I'll try to get by with a single timestamp and save 16 bytes
per record". Or maybe "Why waste the bytes? I'll just store two
timestamps".

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2009-12-16 00:58:14 Re: Range types
Previous Message Scott Bailey 2009-12-16 00:25:32 Re: Range types