Re: the XID question - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: the XID question
Date
Msg-id 4D36DBE202000025000397F8@gw.wicourts.gov
Whole thread Raw
In response to Re: the XID question  (Andres Freund <andres@anarazel.de>)
Responses Re: the XID question  (Greg Smith <greg@2ndquadrant.com>)
List pgsql-performance
Andres Freund <andres@anarazel.de> wrote:
> On Wednesday, January 19, 2011 07:06:58 PM Chris Browne wrote:

>> A read-only transaction won't consume XIDs, but if you don't
>> expressly declare it read-only, they're still liable to get
>> eaten...
> No. The Xid is generally only allocated at the first place a real
> xid is needed. See GetCurrentTransactionId, AssignTransactionId in
> xact.c and the caller of the former.

Or just test it in psql.  BEGIN, run your query, look at pg_locks.
If an xid has been assigned, you'll see it there in the
transactionid column.  You can easily satisfy yourself which
statements grab an xid....

-Kevin

pgsql-performance by date:

Previous
From: Andres Freund
Date:
Subject: Re: the XID question
Next
From: Bruce Momjian
Date:
Subject: Re: anti-join chosen even when slower than old plan