Re: Help with count(*)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Will LaShell <will(at)lashell(dot)net>, Hannu Krosing <hannu(at)tm(dot)ee>, Christopher Browne <cbbrowne(at)acm(dot)org>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Help with count(*)
Date: 2003-11-16 15:22:43
Message-ID: 26338.1068996163@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

Neil Conway <neilc(at)samurai(dot)com> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> (I believe the previous discussion also agreed that we wanted to
>> postpone the freezing of now(), which currently also happens at
>> BEGIN rather than the first command after BEGIN.)

> That doesn't make sense to me: from a user's perspective, the "start
> of the transaction" is when the BEGIN is issued, regardless of any
> tricks we may play in the backend.

That's defensible when the user issued the BEGIN himself. When the
BEGIN is coming from some interface library's autocommit logic, it's
a lot less defensible. If you consult the archives, you will find
actual user complaints about "why is now() returning a very old time?"
that we traced to use of interface layers that handle "commit()" by
issuing "COMMIT; BEGIN;".

When BEGIN actually is issued by live application logic, I'd expect it
to be followed immediately by some kind of command --- so the user would
be unable to tell the difference in practice.

Hannu moved this thread to -hackers, please follow up there if you want
to discuss it more.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dennis Bjorklund 2003-11-16 15:51:49 Re: start of transaction (was: Re: [PERFORM] Help with
Previous Message Tom Lane 2003-11-16 14:50:11 Re: start of transaction (was: Re: [PERFORM] Help with count(*))

Browse pgsql-performance by date

  From Date Subject
Next Message Dennis Bjorklund 2003-11-16 15:51:49 Re: start of transaction (was: Re: [PERFORM] Help with
Previous Message Tom Lane 2003-11-16 14:50:11 Re: start of transaction (was: Re: [PERFORM] Help with count(*))