Re: Fixed length data types issue

From: Gregory Stark <gsstark(at)mit(dot)edu>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Martijn van Oosterhout <kleptog(at)svana(dot)org>
Subject: Re: Fixed length data types issue
Date: 2006-09-07 21:00:40
Message-ID: 87zmdbxuh3.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Peter Eisentraut <peter_e(at)gmx(dot)net> writes:

> Gregory Stark wrote:
> > By my count postgres would use 154 bytes for this record. Whereas in
> > fact there's no need for it to take more than 87 bytes. Almost 100%
> > overhead for varattlen headers and the padding they necessitate.
>
> The thing is, 100% extra space is cheap, but the processing power for
> making the need for that extra space go away is not.

That's simply untrue for most applications. Unless you can fit much of your
database into RAM that 100% extra space translates directly into 100% slower.

This is most obviously the case for data warehouses that are doing lots of
sequential scans of tables that don't fit in cache.

But it's largely true for OLTP applications too. The more compact the data the
more tuples fit on a page and the greater the chance you have the page you
need in cache.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2006-09-07 21:07:27 Re: Fixed length data types issue
Previous Message Gregory Stark 2006-09-07 20:57:04 Re: Fixed length data types issue