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

Поиск
Список
Период
Сортировка
От Vadim Mikheev
Тема Re: [HACKERS] Anyone understand shared buffer refcount mechanism?
Дата
Msg-id 37E59458.64D563D@krs.ru
обсуждение исходный текст
Ответ на Anyone understand shared buffer refcount mechanism?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Anyone understand shared buffer refcount mechanism?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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
makessure that when ExecutorRun's are called recursively as for* postquel functions, the buffers pinned by one
ExecutorRunwill 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vadim Mikheev
Дата:
Сообщение: Re: [HACKERS] Why do we need pg_vlock?
Следующее
От: Vadim Mikheev
Дата:
Сообщение: Re: [HACKERS] couldn't rollback cache ?