Re: Higher TOAST compression.

From: Laurent Laborde <kerdezixe(at)gmail(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: jd(at)commandprompt(dot)com, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Higher TOAST compression.
Date: 2009-07-20 15:04:54
Message-ID: 8a1bfe660907200804n108a8779wfdbedeee0cbd359c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi again !

I also take a look at another possibility to improve compression.

There is two compression strategy :
static const PGLZ_Strategy strategy_default_data = {
256, /* Data chunks less than 256 bytes are not
* compressed */
6144, /* Data chunks >= 6K force compression, unless
* compressed output is larger than input */
20, /* Below 6K, compression rates below 20% mean
* fallback to uncompressed */
128, /* Stop history lookup if a match of 128 bytes
* is found */
10 /* Lower good match size by 10% at every
* lookup loop iteration */
};
const PGLZ_Strategy *const PGLZ_strategy_default = &strategy_default_data;

static const PGLZ_Strategy strategy_always_data = {
0, /* Chunks of any size are compressed */
0,
0, /* It's enough to save one single byte */
128, /* Stop history lookup if a match of 128 bytes
* is found */
6 /* Look harder for a good match */
};
const PGLZ_Strategy *const PGLZ_strategy_always = &strategy_always_data;

1) "strategy_always_data" seems to never be used.
2) the default strategy could be more aggressive (with a higher cpu cost)

Additionally, we use a patched version that modify the default strategy.
If i understand correctly, instead of being more aggresive on
compression, it is *LESS* aggresive :

static const PGLZ_Strategy strategy_default_data = {
32, /* Data chunks less than 32
bytes are not compressed */
1024 * 1024, /* Data chunks over 1MB are not compressed either */
25, /* Require 25% compression
rate, or not worth it */
1024, /* Give up if no compression in the first 1KB */
128, /* Stop history lookup if a match of
128 bytes is found */
10 /* Lower good match size by
10% at every loop iteration */
};
const PGLZ_Strategy *const PGLZ_strategy_default = &strategy_default_data;

Isn't it ?

What about setting "PGLZ_strategy_always" as the default strategy
(insane cpu cost ?) ?
Or something in-between ?

Thank you.

--
Laurent Laborde
Sysadmin @ http://www.over-blog.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jaime Casanova 2009-07-20 15:08:18 Re: fix: plpgsql: return query and dropped columns problem
Previous Message David Fetter 2009-07-20 14:58:06 Re: WIP: Deferrable unique constraints