Re: Design notes for BufMgrLock rewrite - Mailing list pgsql-hackers

From Richard Huxton
Subject Re: Design notes for BufMgrLock rewrite
Date
Msg-id 42145250.1050202@archonet.com
Whole thread Raw
In response to Re: Design notes for BufMgrLock rewrite  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> "Jim C. Nasby" <decibel@decibel.org> writes:
> 
>>The advantage of using a counter instead of a simple active
>>bit is that buffers that are (or have been) used heavily will be able to
>>go through several sweeps of the clock before being freed. Infrequently
>>used buffers (such as those from a vacuum or seq.  scan), would get
>>marked as inactive the first time they were hit by the clock hand.

> What I'm envisioning is that pinning (actually unpinning) a buffer
> increments the counter (up to some limit), and the clock sweep
> decrements it (down to zero), and only buffers with count zero are taken
> by the sweep for recycling.

Would there be any value in incrementing by 2 for index accesses and 1 
for seq-scans/vacuums? Actually, it should probably be a ratio based on 
random_page_cost shouldn't it?

--   Richard Huxton  Archonet Ltd


pgsql-hackers by date:

Previous
From: Dennis Bjorklund
Date:
Subject: Re: Help me recovering data
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: Urgent problem: Unicode characters greater than or