Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id E7EB31337B90 for ; Wed, 19 Jan 2011 14:25:47 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 93737-06-4 for ; Wed, 19 Jan 2011 18:25:40 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id 8B5AF1337B93 for ; Wed, 19 Jan 2011 14:25:40 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.4/8.14.4) with ESMTP id p0JIPeut005191 for ; Wed, 19 Jan 2011 14:25:40 -0400 (AST) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.4/8.14.4/Submit) id p0JI82eo068370 for pgsql-performance@postgresql.org; Wed, 19 Jan 2011 14:08:02 -0400 (AST) (envelope-from news) From: Chris Browne X-Newsgroups: pgsql.performance Subject: Re: the XID question Date: Wed, 19 Jan 2011 13:06:58 -0500 Organization: cbbrowne Computing Inc Lines: 25 Message-ID: <878vyg9399.fsf@cbbrowne.afilias-int.info> References: <4D36A35302000025000397CC@gw.wicourts.gov> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:intX7t9erJWR4tbRZUXct82b3/I= To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/171 X-Sequence-Number: 41958 Kevin.Grittner@wicourts.gov ("Kevin Grittner") writes: > Filip Rembia*kowski wrote: >> 2011/1/19 Charles.Hou : > >>> " 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.