Re: Nested xacts: looking for testers and review

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Nested xacts: looking for testers and review
Дата
Msg-id 20040529032503.GA11208@dcc.uchile.cl
обсуждение исходный текст
Ответ на Re: Nested xacts: looking for testers and review  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Nested xacts: looking for testers and review  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
On Fri, May 28, 2004 at 11:11:27PM -0400, Bruce Momjian wrote:
> Alvaro Herrera wrote:

> > I think this applies to all GUC variables, but I wonder if we want to
> > save the value of each one at subtransaction start and recover it at
> > abort?  Things could easily get huge.  Maybe only saving the ones that
> > are different from the default value, and from the last saved value.
> 
> We have an on-commit field in the guc structures to handle
> commit/rollback settings.  Do we need to extend that to subtransactions?

Yes IMHO.  I'm not sure actually _how_ should this be handled.  Maybe
the on-commit field should go away and be replaced by something more
general (probably a stack, like everything else).  Let me look at the
code.

> I don't think you can save off only the defaults in an efficient manner.

What do you mean by efficient?  Space efficient?  It will be much more
efficient to save only the changed values.  Time efficient?  We will
have to traverse the whole list anyway, whether we only save the changed
values or all of them.

Remember, we already traverse the whole list of shared buffers, the
whole CatCache, the whole Relcache, maybe do some repallocs, and lots of
other stuff.  Traversing the whole GUC array does not seem all that
expensive to me ...  After all, we are saving lots of I/O if subxacts
are used correctly (try, rollback, try again -- you save the XLog for
the first try.)

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Oh, great altar of passive entertainment, bestow upon me thy discordant images
at such speed as to render linear thought impossible" (Calvin a la TV)



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: temp tables broken in CVS HEAD?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Nested xacts: looking for testers and review