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/

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to