Re: WAL format changes - Mailing list pgsql-hackers

From Greg Stark
Subject Re: WAL format changes
Date
Msg-id CAM-w4HMe_Ty-6bbqE_3A55q8M5OnjdPrqQJXBW51tM6nOi9L9A@mail.gmail.com
Whole thread Raw
In response to WAL format changes  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Thu, Jun 14, 2012 at 10:01 PM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> This has the advantage that you can calculate the CRC for all the other
> fields before acquiring WALInsertLock. For xl_prev, you need to know where
> exactly the record is inserted, so it's handy that it's the last field
> before CRC.

It may be late to mention this but fwiw you don't need to reorder the
fields to do this. CRC has the property that you can easily adjust it
for any changes to the data covered by it. Regardless of where the
xl_prev link is you can calculate the CRC as if xl_prev is 0 and then
once you get the lock "add in" the correct xl_prev. This is an
argument in favour of using CRC over other checksums for which that
would be hard or impossible.

-- 
greg


pgsql-hackers by date:

Previous
From: Jan Urbański
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Fix mapping of PostgreSQL encodings to Python encodings.
Next
From: Peter Eisentraut
Date:
Subject: Re: transforms