Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 5BE7B2E004D for ; Fri, 28 Mar 2008 02:52:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 89502-07 for ; Fri, 28 Mar 2008 02:52:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from vms173003pub.verizon.net (vms173003pub.verizon.net [206.46.173.3]) by postgresql.org (Postfix) with ESMTP id 969D22E007C for ; Fri, 28 Mar 2008 02:52:06 -0300 (ADT) Received: from new-host.home ([71.245.161.199]) by vms173003.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JYF00H5OETSJDQ4@vms173003.mailsrvcs.net> for pgsql-hackers@postgresql.org; Fri, 28 Mar 2008 00:49:05 -0500 (CDT) Date: Fri, 28 Mar 2008 01:51:54 -0400 From: Robert Treat Subject: Re: [COMMITTERS] pgsql: Fix TransactionIdIsCurrentTransactionId() to use binary search In-reply-to: <2092.1206652297@sss.pgh.pa.us> To: Tom Lane Cc: pgsql-hackers@postgresql.org Message-id: <200803280151.54874.xzilla@users.sourceforge.net> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-15 Content-transfer-encoding: 7bit Content-disposition: inline References: <20080317021856.0D2D37558DC@cvs.postgresql.org> <200803271656.45574.xzilla@users.sourceforge.net> <2092.1206652297@sss.pgh.pa.us> User-Agent: KMail/1.9.1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/1151 X-Sequence-Number: 115952 On Thursday 27 March 2008 17:11, Tom Lane wrote: > Robert Treat writes: > > On Sunday 16 March 2008 22:18, Tom Lane wrote: > >> Fix TransactionIdIsCurrentTransactionId() to use binary search instead > >> of linear search when checking child-transaction XIDs. > > > > Are there any plans to backpatch this into REL8_3_STABLE? > > No. > > > It looks like I am > > hitting a pretty serious performance regression on 8.3 with a stored > > procedure that grabs a pretty big recordset, and loops through doing > > insert....update on unique failures. The procedure get progressivly > > slower the more records involved... and dbx shows me stuck in > > TransactionIdIsCurrentTransactionId(). > > If you can convince me it's a regression I might reconsider, but I > rather doubt that 8.2 was better, > Well, I can't speak for 8.2, but I have a second system crunching the same data using the same function on 8.1 (on lesser hardware in fact), and it doesn't have these type of issues. Looking over the past week, the 8.3 box averages about 19 minutes to complete each run, and the 8.1 box averages 15 minutes (sample size is over 100 iterations of both). Of course this is when it completes, the 8.3 box often does not complete, as it falls farther behind during the day and eventually cannot finish (it does periodic intra-day summing, so there's a limited time frame it has to run, and it's jobs end up taking hours to complete). I am open to the idea that there is some other issue going on here, but whenever I look at it, it seems stuck in TransactionIdIsCurrentTransactionId(), progress for the function does get increasingly slower as it progresses, and I can watch the process consuming more and more memory as it goes on... I can probably get some dtrace output tommorrow if you want. -- Robert Treat Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL