Re: [PATCHES] log session end - again

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] log session end - again
Date: 2004-02-03 03:31:40
Message-ID: 10833.1075779100@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan <andrew(at)dunslane(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-02-03 03:45:22 Re: 7.5 change documentation
Previous Message scott.marlowe 2004-02-03 01:07:29 Re: Idea about better configuration options for sort memory

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-02-03 04:26:17 Re: fix memcpy() overlap
Previous Message Tom Lane 2004-02-03 02:27:46 Re: Fix memcmp() with different sizes.