Re: HOT patch - version 15

Поиск
Список
Период
Сортировка
От Pavan Deolasee
Тема Re: HOT patch - version 15
Дата
Msg-id 2e78013d0709052010t4d3a2c94o1f3cc5bbfa1223f3@mail.gmail.com
обсуждение исходный текст
Ответ на Re: HOT patch - version 15  (Gregory Stark <stark@enterprisedb.com>)
Ответы Re: HOT patch - version 15  (Gregory Stark <stark@enterprisedb.com>)
Re: HOT patch - version 15  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Список pgsql-patches

On 9/6/07, Gregory Stark <stark@enterprisedb.com> wrote:
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

>
> ISTM the only time we should be doing HOT cleanup work is when we are
> trying to insert a new tuple on that page --- and maybe even only when
> we try and it doesn't fit straight off.  Otherwise you're pushing
> maintenance work into foreground query pathways, which is exactly where
> I don't think we should be headed.

Ah, as I understand it you can't actually do the pruning then because the
executor holds references to source tuple on the page. In other words you can
never "get the vacuum lock" there because you already have the page pinned
yourself.


I don't think executor holding a reference is a problem because when
we check for vacuum lock, we have already pinned the page anyways.
But moving the old tuple around deep down in the UPDATE code path
(when we realize that there is no free space) is an issue. I know Heikki
tried to do it this way - but then moved the pruning code to lookup
code. Heikki ?

Another real problem with doing pruning only in UPDATE path is that
we may end up with long HOT chains if the page does not receive a
UPDATE, after many consecutive HOT updates. Every lookup to the
visible tuple in this chain would be CPU expensive since it would require
long chain following.

The downside is of course that SELECT may occasionally do more work.
But since we ensure that we do the extra work only when there is no
contention on the page, ISTM that the downside is limited.


Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB     http://www.enterprisedb.com

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

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: HOT patch - version 15
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: HOT patch - version 15