From: | Heikki Linnakangas <heikki(at)enterprisedb(dot)com> |
---|---|
To: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gregory Stark <stark(at)enterprisedb(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Seq scans status update |
Date: | 2007-05-29 17:23:16 |
Message-ID: | 465C6184.6020206@enterprisedb.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
Alvaro Herrera wrote:
> Tom Lane wrote:
>> Gregory Stark <stark(at)enterprisedb(dot)com> writes:
>>> Is there a reason UnpinBuffer has to be the one to increment the usage count
>>> anyways? Why can't ReadBuffer handle incrementing the count and just trust
>>> that it won't be decremented until the buffer is unpinned anyways?
>> That's a good question. I think the idea was that if we hold a buffer
>> pinned for awhile (long enough that the bgwriter's clock sweep passes
>> over it one or more times), we want the usage count decrementing to
>> start when we release the pin, not when we acquire it. But maybe that
>> could be fixed if the clock sweep doesn't touch the usage_count of a
>> pinned buffer. Which in fact it may not do already --- didn't look.
>
> It does -- in BgBufferSync the "all" scan calls SyncOneBuffer with
> skip_pinned=false. The "lru" scan does skip pinned buffers.
You're looking at the wrong place. StrategyGetBuffer drives the clock
sweep, and it always decreases the usage_count, IOW it doesn't skip
pinned buffers. SyncOneBuffer and BgBufferSync don't decrease the
usage_count in any case.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2007-05-29 17:52:08 | WIP: 2nd-generation buffer ring patch |
Previous Message | Gregory Stark | 2007-05-29 17:02:51 | Re: Concurrent psql patch |