Re: Nested xacts: looking for testers and review

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Nested xacts: looking for testers and review
Date: 2004-05-29 03:25:03
Message-ID: 20040529032503.GA11208@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-05-29 03:31:58 Re: Nested xacts: looking for testers and review
Previous Message Bruce Momjian 2004-05-29 03:19:42 Re: temp tables broken in CVS HEAD?