Re: Table and Index compression

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Table and Index compression
Date: 2009-08-07 11:59:57
Message-ID: 407d949e0908070459l5a3e855cu2ed146f7e18c57bc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 7, 2009 at 12:48 PM, Sam Mason<sam(at)samason(dot)me(dot)uk> wrote:
>> Well most users want compression for the space savings. So running out
>> of space sooner than without compression when most of the space is
>> actually unused would disappoint them.
>
> Note, that as far as I can tell for a filesystems you only need to keep
> enough reserved for the amount of uncompressed dirty buffers you have in
> memory.  As space runs out in the filesystem all that happens is that
> the amount of (uncompressed?) dirty buffers you can safely have around
> decreases.

And when it drops to zero?

> In PG's case, it would seem possible to do the compression and then
> check to see if the resulting size is greater than 4kB.  If it is you
> write into the 4kB page size and write uncompressed data.  Upon reading
> you do the inverse, if it's 4kB then no need to decompress.  I believe
> TOAST does this already.

It does, as does gzip and afaik every compression system.

--
greg
http://mit.edu/~gsstark/resume.pdf

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2009-08-07 12:18:22 Re: Table and Index compression
Previous Message Michael Meskes 2009-08-07 11:55:48 Re: Split-up ECPG patches