Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id C602F2E2DAF for ; Tue, 11 Mar 2008 11:04:54 -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 94259-02-4 for ; Tue, 11 Mar 2008 11:04:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail01.enterprisedb.com (webmail.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id 22A982E2E39 for ; Tue, 11 Mar 2008 11:03:16 -0300 (ADT) thread-index: AciDgLm/34sSim+LRcmPgio0Z53WuA== Received: from [172.24.32.184] ([62.232.55.118]) by mail01.enterprisedb.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 11 Mar 2008 10:03:46 -0400 Content-Class: urn:content-classes:message Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133 Message-ID: <47D6911C.3040605@enterprisedb.com> Date: Tue, 11 Mar 2008 14:03:08 +0000 From: "Heikki Linnakangas" Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.9 (X11/20080110) MIME-Version: 1.0 To: "Alvaro Herrera" Cc: "Tom Lane" , "Craig Ringer" , "pgsql-patches" Subject: Re: [PERFORM] Very slow (2 tuples/second) sequentialscan after bulk insert; speed returns to ~500 tuples/second aftercommit References: <47D505AF.4040101@postnewspapers.com.au> <47D5150C.8090802@enterprisedb.com> <23588.1205159638@sss.pgh.pa.us> <47D54A47.3030608@postnewspapers.com.au> <47D54DB2.4020405@enterprisedb.com> <24304.1205162440@sss.pgh.pa.us> <47D67C3F.1030406@enterprisedb.com> <20080311132904.GA9116@alvh.no-ip.org> In-Reply-To: <20080311132904.GA9116@alvh.no-ip.org> Content-Type: text/plain; format=flowed; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 11 Mar 2008 14:03:46.0640 (UTC) FILETIME=[B9357500:01C88380] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/156 X-Sequence-Number: 5219 Alvaro Herrera wrote: > Heikki Linnakangas wrote: > >> I couldn't let this case go, so I wrote a patch. I replaced the linked >> list with an array that's enlarged at AtSubCommit_childXids when >> necessary. > > Do you still need to palloc the return value from > xactGetCommittedChildren? Perhaps you can save the palloc/memcpy/pfree > and just return the pointer to the array already in memory? Yeah, good point. The callers just need to be modified not to pfree it. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com