Re: Set hint bits upon eviction from BufMgr - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: Set hint bits upon eviction from BufMgr
Date
Msg-id 3C21A3CC-4707-483C-AD38-9B013E2D1732@nasby.net
Whole thread Raw
In response to Set hint bits upon eviction from BufMgr  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: Set hint bits upon eviction from BufMgr
List pgsql-hackers
On Mar 25, 2011, at 9:52 AM, Merlin Moncure wrote:
> Without this bit, the only way to set hint bits going during bufmgr
> eviction is to do a visibility check on every tuple, which would
> probably be prohibitively expensive.  Since OLTP environments would
> rarely see this bit, they would not have to pay for the check.

IIRC one of the biggest costs is accessing the CLOG, but what if the bufmgr.c/bgwriter didn't use the same CLOG lookup
mechanismas backends did? Unlike when a backend is inspecting visibility, it's not necessary for something like
bgwriterto know exact visibility as long as it doesn't mark something as visible when it shouldn't. If it uses a
differentCLOG caching/accessing method that lags behind the real CLOG then the worst-case scenario is that there's a
delayon setting hint bits. But getting grwiter to dothis would likely still be a huge win over forcing backends to
worryabout it. It's also possible that the visibility check itself could be simplified. 

BTW, I don't think you want to play these games when a backend is evicting a page because you'll be slowing a real
backenddown. 
--
Jim C. Nasby, Database Architect                   jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Re: making write location work (was: Efficient transaction-controlled synchronous replication)
Next
From: Stephen Frost
Date:
Subject: Transactional DDL, but not Serializable