Re: forcing compression of text field

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: forcing compression of text field
Дата
Msg-id 21311.1165884823@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: forcing compression of text field  (Scott Marlowe <smarlowe@g2switchworks.com>)
Ответы Re: forcing compression of text field  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-general
Scott Marlowe <smarlowe@g2switchworks.com> writes:
> On Mon, 2006-12-11 at 10:18, Jonathan Ellis wrote:
>> I have a table of log messages.  They are mostly in the 100-200
>> character length, which apparently isn't large enough for PG to want
>> to compress it (length == octet_length).  I really need to save disk
>> space.  I can store it as a bytea and compress it manually (zlib level
>> 1 compression gives about 50% savings), but is there a way to force
>> pg's own compression before I resort to this?

> http://www.postgresql.org/docs/8.1/interactive/storage-toast.html
> Has all your answers.

The bottom line is that PG doesn't bother trying to compress values
less than about 2KB long.  While you could make a custom build with a
different threshold, the fact remains that LZ-style compression is not
real efficient on short stretches of text.  If you "really need to save
disk space" it behooves you to consider that.  I'd suggest thinking about
whether you can merge multiple log entries, or something, such that the
field values you need to store are on the order of a few KB.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Glen Parker
Дата:
Сообщение: PITR and moving objects between table spaces
Следующее
От: "Lenorovitz, Joel"
Дата:
Сообщение: Metadata from NEW and OLD constructs?