Re: start of transaction (was: Re: [PERFORM] Help with

From: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hannu Krosing <hannu(at)tm(dot)ee>, Neil Conway <neilc(at)samurai(dot)com>, Will LaShell <will(at)lashell(dot)net>, Christopher Browne <cbbrowne(at)acm(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: start of transaction (was: Re: [PERFORM] Help with
Date: 2003-11-16 15:51:49
Message-ID: Pine.LNX.4.44.0311161645350.26313-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

On Sun, 16 Nov 2003, Tom Lane wrote:

> There isn't any compelling implementation reason when to freeze the
> value of now(). Reasonable options are
> 1. at BEGIN (current behavior)
> 2. at transaction's external creation
> 3. at freezing of transaction snapshot
> #1 and #2 are actually the same at the moment, but could be decoupled
> as sketched above, in which case the behavior of #2 would effectively
> become "at first command afte BEGIN".
>
> I argued that now() should be frozen at the time of the transaction
> snapshot, and I still think that that's a defensible behavior.

Is it important exactly what value is returned as long as it's the same in
the whole transaction? I think not.

To me it would be just as logical to fix it at the first call to now() in
the transaction. The first time you call it you get the actual time as it
is now and the next time you get the same as before since every operation
in the transaction logically happens at the same time. If you don't call
now() at all, the system time will not be fetched at all.

--
/Dennis

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-11-16 16:32:59 Re: [PATCHES] SRA Win32 sync() code
Previous Message Tom Lane 2003-11-16 15:22:43 Re: Help with count(*)

Browse pgsql-performance by date

  From Date Subject
Next Message Neil Conway 2003-11-16 22:55:41 Re: start of transaction (was: Re: [PERFORM] Help with count(*))
Previous Message Tom Lane 2003-11-16 15:22:43 Re: Help with count(*)