Re: How does TOAST compare to other databases' mechanisms?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: Frank Joerdens <frank(at)joerdens(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: How does TOAST compare to other databases' mechanisms?
Date: 2000-10-09 14:12:43
Message-ID: 25177.971100763@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> In the case of images, is there a way to tell TOAST not to bother even
> trying to compress the data? (eg. JPEG files). If so, would I be right in
> assuming that this would be better for fast retrieval (even for text
> files)?

TOAST will not store a compressed value unless the compressed value is
smaller than the uncompressed by some reasonable amount (which looks to
be 20% by default). I'd expect JPEG-like data always to fail the
compression ratio check. So there's no significant CPU cost at read
time, but there's some cost at write time to try to do the compression.

There is a provision to discourage the toaster from even trying to
compress a particular column --- see the attstorage column in
pg_attribute. At the moment there's no user interface for that :-(
so you'd have to reach in with a manual "UPDATE pg_attribute" to
change it from the default value. Someone should work on adding an
ALTER command to change it in a more user-friendly fashion.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adam Lang 2000-10-09 14:42:14 Re: image storing
Previous Message John Menke 2000-10-09 13:55:59 Win98