Re: Faster compression, again - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Faster compression, again
Date
Msg-id CA+Tgmob0M6p69bdrFXXGUbKLqTz4i5ytL+e_B3ZN4D51-cUFQw@mail.gmail.com
Whole thread Raw
In response to Re: Faster compression, again  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Faster compression, again  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Mar 14, 2012 at 6:08 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Another not-exactly-trivial requirement is to figure out how to
>> not break on-disk compatibility when installing an alternative
>> compression scheme.  In hindsight it might've been a good idea if
>> pglz_compress had wasted a little bit of space on some sort of
>> version identifier ... but it didn't.
>
> Doesn't it always start with a header of two int32 values where the
> first must be smaller than the second?  That seems like enough to
> get traction for an identifiably different header for an alternative
> compression technique.

The first of those words is vl_len_, which we can't fiddle with too
much, but the second is rawsize, which we can definitely fiddle with.
Right now, rawsize < vl_len_ means it's compressed; and rawsize ==
vl_len_ means it's uncompressed.  As you point out, rawsize > vl_len_
is undefined; also, and maybe simpler, rawsize < 0 is undefined.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pg_upgrade and statistics
Next
From: Tom Lane
Date:
Subject: EquivalenceClasses and subqueries and PlaceHolderVars, oh my