From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Treat <xzilla@users.sourceforge.net>
Cc: pgsql-performance@postgresql.org, Alvaro Herrera <alvherre@commandprompt.com>
Subject: Re: Re: [HACKERS] [COMMITTERS] pgsql: Fix TransactionIdIsCurrentTransactionId() to use binary search
Date: Sat, 26 Apr 2008 19:20:29 -0400
Message-ID: <11001.1209252029@sss.pgh.pa.us> (raw)
In-Reply-To: <200804261420.16064.xzilla@users.sourceforge.net>
References: <20080317021856.0D2D37558DC@cvs.postgresql.org>
<200804260910.55203.xzilla@users.sourceforge.net>
<13180.1209230804@sss.pgh.pa.us>
<200804261420.16064.xzilla@users.sourceforge.net>
Robert Treat <xzilla@users.sourceforge.net> writes:
> On Saturday 26 April 2008 13:26, Tom Lane wrote:
>> Oh, you failed to state that the dtrace output was post-patch. You need
>> to show *pre* patch dtrace output if you want us to think it relevant.
> Please read up-thread.
Sorry, I'd forgotten your previous post.
I poked around for calls to TransactionIdIsCurrentTransactionId that
are in current code and weren't in 8.1. I found these:
src/backend/commands/analyze.c: 965: if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmin(targtuple.t_data)))
src/backend/commands/analyze.c: 984: if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(targtuple.t_data)))
src/backend/commands/cluster.c: 803: if (!TransactionIdIsCurrentTransactionId(
src/backend/commands/cluster.c: 816: if (!TransactionIdIsCurrentTransactionId(
src/backend/storage/ipc/procarray.c: 374: if (TransactionIdIsCurrentTransactionId(xid))
src/backend/utils/time/combocid.c: 108: Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmin(tup)));
src/backend/utils/time/combocid.c: 123: Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tup)));
src/backend/utils/time/combocid.c: 156: TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmin(tup)))
The ANALYZE and CLUSTER calls are not likely to be your issue, but the
one in HeapTupleHeaderAdjustCmax could get called a lot, and the one
in TransactionIdIsInProgress definitely will get called a lot.
Neither of those calls existed in 8.2.
So I think that explains why TransactionIdIsCurrentTransactionId has
become more performance-critical in 8.3 than it was before. Will
apply the back-patch.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, xzilla@users.sourceforge.net, alvherre@commandprompt.com
Subject: Re: Re: [HACKERS] [COMMITTERS] pgsql: Fix TransactionIdIsCurrentTransactionId() to use binary search
In-Reply-To: <11001.1209252029@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox