Re: the XID question - Mailing list pgsql-performance

From Chris Browne
Subject Re: the XID question
Date
Msg-id 878vyg9399.fsf@cbbrowne.afilias-int.info
Whole thread Raw
In response to the XID question  ("Charles.Hou" <givemeegn@gmail.com>)
Responses Re: the XID question
List pgsql-performance
Kevin.Grittner@wicourts.gov ("Kevin Grittner") writes:
> Filip Rembia*kowski<plk.zuber@gmail.com> wrote:
>> 2011/1/19 Charles.Hou <givemeegn@gmail.com>:
>
>>> " select * from mybook" SQL command also increase the XID ?
>>
>> Yes. Single SELECT is a transaction. Hence, it needs a transaction
>> ID.
>
> No, not in recent versions of PostgreSQL.  There's virtual
> transaction ID, too; which is all that's needed unless the
> transaction writes something.
>
> Also, as a fine point, if you use explicit database transactions
> (with BEGIN or START TRANSACTION) then you normally get one XID for
> the entire transaction, unless you use SAVEPOINTs.

Erm, "not *necessarily* in recent versions of PostgreSQL."

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...
--
(format nil "~S@~S" "cbbrowne" "gmail.com")
http://www3.sympatico.ca/cbbrowne/lisp.html
Parenthesize to avoid ambiguity.

pgsql-performance by date:

Previous
From: Fabrízio de Royes Mello
Date:
Subject: Re: Running PostgreSQL as fast as possible no matter the consequences
Next
From: Andres Freund
Date:
Subject: Re: the XID question