Re: [HACKERS] Anyone understand shared buffer refcount mechanism?

From: Vadim Mikheev <vadim(at)krs(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Anyone understand shared buffer refcount mechanism?
Date: 1999-09-20 01:56:40
Message-ID: 37E59458.64D563D@krs.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
> In trying to understand what the code is doing, I am confused by the
> buffer refcount save/restore mechanism. Why does the executor want
> to save/restore buffer refcounts? I can sort of see that that might

...

> If anyone understands why this mechanism is designed this way,
> please tell me about it.

This bothered me for long time too.
The only explanation I see in execMain.c:

/*
* reset buffer refcount. the current refcounts are saved and will be
* restored when ExecutorEnd is called
*
* this makes sure that when ExecutorRun's are called recursively as for
* postquel functions, the buffers pinned by one ExecutorRun will not
* be unpinned by another ExecutorRun.
*/

But buffers pinned by one Executor invocation SHOULDN'T
be unpinned by another one (if there are no bugs in code,
but this is another story).

So, try to remove this save/restore mechanism and let's see...

Vadim

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vadim Mikheev 1999-09-20 02:17:18 Re: [HACKERS] couldn't rollback cache ?
Previous Message Vadim Mikheev 1999-09-20 01:25:47 Re: [HACKERS] Why do we need pg_vlock?