Re: Fixed length data types issue - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Fixed length data types issue
Date
Msg-id 87zmdbxuh3.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Fixed length data types issue  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Fixed length data types issue  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Fixed length data types issue  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.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



pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Fixed length data types issue
Next
From: Gregory Stark
Date:
Subject: Re: Fixed length data types issue