Re: Block-level CRC checks - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Block-level CRC checks
Date
Msg-id 87vdusu1bq.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Block-level CRC checks  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Block-level CRC checks  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:

> The other thing that maybe you didn't notice is that lp_flags are 2
> bits, not a full byte.  A byte-at-a-time CRC calculation is no help
> there.

I think we're talking past each other. Martin and I are talking about doing
something like:

for (...) ... crc(word including hint bits) ...
for (each line pointer) crc-negated(word & LP_DEAD<<15)
Because CRC is a cyclic checksum it's possible to add or remove bits
incrementally. This only works if the data is already copied to someplace so
you can be sure nobody will set or clear the bits behind your back. But when
you're reading the data back in you don't have to worry about that.

I'm a bit surprised to hear our CRC implementation is a bytewise loop. I
thought it was much faster to process CRC checks word-wise.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's PostGIS support!


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Reducing some DDL Locks to ShareLock
Next
From: Ron Mayer
Date:
Subject: Re: Re: Updated interval patches - ECPG [was, intervalstyle....]