Re: [HACKERS] compression in LO and other fields

From: The Hermit Hacker <scrappy(at)hub(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jan Wieck <wieck(at)debis(dot)com>, zakkr(at)zf(dot)jcu(dot)cz, t-ishii(at)sra(dot)co(dot)jp, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] compression in LO and other fields
Date: 1999-11-13 02:02:10
Message-ID: Pine.BSF.4.10.9911122156360.2296-100000@thelab.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 12 Nov 1999, Tom Lane wrote:

> wieck(at)debis(dot)com (Jan Wieck) writes:
> > Tom Lane wrote:
> >> It occurred to me last night that applying compression to individual
> >> fields might not be the best approach. Certainly a "bytez" data type
> >> is the easiest thing to fit into the existing system, but it's leaving
> >> some space savings on the table. What about compressing the *whole*
> >> data contents of a tuple on-disk, as a single entity? That should save
> >> more space than field-by-field compression.
>
> > But it requires decompression of every tuple into palloc()'d
> > memory during heap access. AFAIK, the heap access routines
> > currently return a pointer to the tuple inside the shm
> > buffer. Don't know what it's performance impact would be.
>
> Good point, but the same will be needed when a tuple is split across
> multiple blocks. I would expect that (given a reasonably fast
> decompressor) there will be a net performance *gain* due to having
> less disk I/O to do.

Right now, we're dealing theory...my concern is what Jan points
out "what it's performance impact would be"...would much harder would it
be to extent our "CREATE TABLE" syntax to do something like:

CREATE TABLE classname ( .. ) compressed;

Or something similar? Something that leaves the ability to do
this in the core, but makes the use of this the choice of the admin?

*Assuming* that I'm also reading this thread correctly, it should
almost be extended into "ALTER TABLE classname SET COMPRESSED on;", or
something like that. Where all new records are *written* compressed (or
uncompressed), but any reads checks if compressed size == uncompressed
size, and decompresses accordingly...

Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy(at)hub(dot)org secondary: scrappy(at){freebsd|postgresql}.org

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-11-13 02:25:02 Re: [HACKERS] compression in LO and other fields
Previous Message Jan Wieck 1999-11-13 01:43:47 Re: [HACKERS] compression in LO and other fields