Re: [PATCHES] log session end - again - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] log session end - again
Date
Msg-id 10833.1075779100@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] log session end - again  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: [PATCHES] log session end - again
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Bruce Momjian wrote:
>> Also, Andrew, on your other patch for log_session_info line, Magnus had
>> the idea of giving each session an id based on the first transaction of
>> the session.

> I did think about using a cluster-wide sequence, if we can make such a 
> thing (might also be useful for system generated UIDs too).

Not a good idea IMHO.  If you do that, then there will be no such thing
as a purely read-only transaction, because *every* transaction will
include a nextval() call.  That means even read-only transactions cannot
commit till the disk spins.

If we want a unique id for transient purposes like logging, then make
some kind of counter in shared memory.  Don't use a sequence, it's much
too heavyweight.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Jan Wieck
Date:
Subject: Re: [pgsql-hackers-win32] What's left?
Next
From: Slavisa Garic
Date:
Subject: COPY from question