Repair cosmetic damage (done by pg_indent?)

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Repair cosmetic damage (done by pg_indent?)
Date: 2007-07-27 15:07:01
Message-ID: 87fy39q416.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


I think these are some more comments which were misaligned by pg_indent a
couple of releases ago. I recall Bruce fixed a bug in pg_indent which was
causing it and the damage looked something like this.

I also reduced the indentation so the comments didn't take so many lines.

Fwiw, do we really not want to compress anything smaller than 256 bytes
(everyone in Postgres uses the default strategy, not the always strategy).

ISTM that with things like CHAR(n) around we might very well have some
databases where compression for smaller sized datums would be beneficial. I
would suggest 32 for the minimum.

Index: pg_lzcompress.c
===================================================================
RCS file: /home/stark/src/REPOSITORY/pgsql/src/backend/utils/adt/pg_lzcompress.c,v
retrieving revision 1.26
diff -c -r1.26 pg_lzcompress.c
*** pg_lzcompress.c 6 Apr 2007 04:21:43 -0000 1.26
--- pg_lzcompress.c 27 Jul 2007 14:43:10 -0000
***************
*** 211,239 ****
* ----------
*/
static const PGLZ_Strategy strategy_default_data = {
! 256, /* Data chunks smaller 256 bytes are not
! * compressed */
! 6144, /* Data chunks greater equal 6K force
! * compression */
! /* except compressed result is greater uncompressed data */
! 20, /* Compression rates below 20% mean fallback
! * to uncompressed */
! /* storage except compression is forced by previous parameter */
! 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, /* We want to save at least 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;

--- 211,233 ----
* ----------
*/
static const PGLZ_Strategy strategy_default_data = {
! 256, /* Data chunks smaller 256 bytes are not compressed */
! 6144, /* Data chunks greater equal 6K force compression unless compressed
! * result is greater uncompressed data */
! 20, /* Compression rates below 20% mean fallback to uncompressed
! * storage unless compression is forced by previous parameter */
! 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, /* We want to save at least 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;

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Gregory Stark 2007-07-27 15:36:22 Document and/or remove unreachable code in tuptoaster.c from varvarlena patch
Previous Message Simon Riggs 2007-07-27 13:53:07 Simplifying stats_ parameters