Re: Seq scans status update - Mailing list pgsql-patches

From Alvaro Herrera
Subject Re: Seq scans status update
Date
Msg-id 20070529155026.GD4667@alvh.no-ip.org
Whole thread Raw
In response to Re: Seq scans status update  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Seq scans status update  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-patches
Tom Lane wrote:
> Gregory Stark <stark@enterprisedb.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.

--
Alvaro Herrera                          Developer, http://www.PostgreSQL.org/
"World domination is proceeding according to plan"        (Andrew Morton)

pgsql-patches by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: [pgsql-patches] Ctid chain following enhancement
Next
From: Gregory Stark
Date:
Subject: Re: Concurrent psql patch