Re: Significantly larger toast tables on 8.4? - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Significantly larger toast tables on 8.4?
Date
Msg-id 20090102224815.GA29489@svana.org
Whole thread Raw
In response to Re: Significantly larger toast tables on 8.4?  ("Robert Haas" <robertmhaas@gmail.com>)
Responses Re: Significantly larger toast tables on 8.4?  ("Gregory Maxwell" <gmaxwell@gmail.com>)
List pgsql-hackers
On Fri, Jan 02, 2009 at 03:35:18PM -0500, Robert Haas wrote:
> Any compression algorithm is going to require you to decompress the
> entire string before extracting a substring at a given offset.  When
> the data is uncompressed, you can jump directly to the offset you want
> to read.  Even if the compression algorithm requires no overhead at
> all, it's going to make the location of the data nondeterministic, and
> therefore force additional disk reads.

So you compromise. You split the data into say 1MB blobs and compress
each individually. Then if someone does a substring at offset 3MB you
can find it quickly. This barely costs you anything in the compression
ratio mostly.

Implementation though, that's harder. The size of the blobs is tunable
also. I imagine the optimal value will probably be around 100KB. (12
blocks uncompressed).

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: dblink vs SQL/MED
Next
From: "Greg Stark"
Date:
Subject: Re: posix_fadvise v22