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

From Tom Lane
Subject Re: Block-level CRC checks
Date
Msg-id 24541.1259709096@sss.pgh.pa.us
Whole thread Raw
In response to Re: Block-level CRC checks  (Richard Huxton <dev@archonet.com>)
List pgsql-hackers
Richard Huxton <dev@archonet.com> writes:
> So what is the cost of calculating the hint-bits for a whole block of
> tuples in one go vs reading that block from actual spinning disk?

Potentially a couple of hundred times worse, if you're unlucky and each
XID on the page requires visiting a different block of clog that's also
not in memory.  The average case probably isn't that bad, but I think
we'd likely be talking at least a factor of two penalty --- you'd be
hopelessly optimistic to assume you didn't need at least one clog visit
per page.

Also, if you want to assume that you're lucky and the XIDs mostly fall
within a fairly recent range of clog pages, you're still not out of the
woods.  In that situation what you are talking about is a spectacular
increase in the hit rate for cached clog pages --- which are already a
known contention bottleneck in many scenarios.

> While on that topic - I'm assuming freezing requires substantially more
> effort than updating hint bits?

It's a WAL-logged page change, so at minimum double the cost.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: enable-thread-safety defaults?
Next
From: Greg Stark
Date:
Subject: Re: [CORE] EOL for 7.4?