Skip site navigation (1) Skip section navigation (2)

Re: Increase of buffers usage count by bgwriter

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Increase of buffers usage count by bgwriter
Date: 2005-10-26 16:06:17
Message-ID: 6879.1130342777@sss.pgh.pa.us (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-hackers
ITAGAKI Takahiro <itagaki(dot)takahiro(at)lab(dot)ntt(dot)co(dot)jp> writes:
> I found that bgwriter increments usage count of buffers when it writes
> the buffers. I feel this behavior is strange, because the behavior of
> bgwriter will affect buffer management strategy.

Good point --- we probably don't want it to do that.

> If the behavior is not intended, another UnpinBuffer that doesn't
> increase the buffers usage count will be needed.
> Otherwise, bgwriter should do behavior that looks like VACUUM, 
> using StrategyHintVacuum(true).

I think it might be sufficient to not increment usage_count when
UnpinBuffer's "trashOK" parameter is false --- that's what
SyncOneBuffer passes, so it'd fix the issue for bgwriter activity,
and arguably all the other call sites that pass false also don't
want the count to increment.

(Probably need a different name for trashOK ...)

Comments?

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Grzegorz Piotr JaskiewiczDate: 2005-10-26 16:29:12
Subject: Re: problem with custom Gist for custom type
Previous:From: Tom LaneDate: 2005-10-26 15:57:23
Subject: Re: add_missing_from breaks existing views

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group