Cost of XLogInsert CRC calculations

From: tzirechnoy(at)hotpop(dot)com
To: pgsql-hackers(at)postgresql(dot)org
Subject: Cost of XLogInsert CRC calculations
Date: 2005-03-09 08:13:25
Message-ID: 20050309081325.GA2573462@krondor.astelecom.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 07, 2005 at 11:53:59PM +0000, Simon Riggs wrote:
> On Mon, 2005-03-07 at 09:39 -0500, Tom Lane wrote:
> > "Mark Cave-Ayland" <m(dot)cave-ayland(at)webbased(dot)co(dot)uk> writes:

[skipped]

> Well, we're using the CRC in 3 separate places...
> (1) for xlog records
> (2) for complete blocks copied to xlog
> (3) for control files
>
> For (1), records are so short that probably CRC16 would be sufficient
> without increasing the error rate noticeably.
>
> I think I'd like to keep (3) at CRC64...its just too important. Plus
> thats slightly less code to change.
>
> My money is on (2) being the source of most of that run-time anyway,
> since when we enclose a whole block it takes a lot longer to CRC64 all
> BLCKSZ bytes than it would do to CRC a single record in (1). But of
> course, longer stretches of data need better error detection rates.

Well, if there is no need for error recovery, than
what about using more simple algorithm, like checksum? Perhaps,
it even could be attached to one of required memcpy calls.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2005-03-09 09:23:39 Re: About b-tree usage
Previous Message Christopher Kings-Lynne 2005-03-09 07:59:34 Re: Current CVS parallel test lock