Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 6853F2E030A for ; Wed, 12 Mar 2008 12:57:38 -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 48764-02 for ; Wed, 12 Mar 2008 12:57:24 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id E83AD2E0104 for ; Wed, 12 Mar 2008 12:57:24 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m2CFvJZZ019903; Wed, 12 Mar 2008 11:57:19 -0400 (EDT) To: "Pavan Deolasee" cc: "Heikki Linnakangas" , "Craig Ringer" , pgsql-patches Subject: Re: [PERFORM] Very slow (2 tuples/second) sequential scan after bulk insert; speed returns to ~500 tuples/second after commit In-reply-to: <2e78013d0803120847k2e8afbedrc39e29e5194d3c6e@mail.gmail.com> 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> <5827.1205269597@sss.pgh.pa.us> <47D7DE12.80700@enterprisedb.com> <2e78013d0803120847k2e8afbedrc39e29e5194d3c6e@mail.gmail.com> Comments: In-reply-to "Pavan Deolasee" message dated "Wed, 12 Mar 2008 21:17:20 +0530" Date: Wed, 12 Mar 2008 11:57:19 -0400 Message-ID: <19902.1205337439@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/191 X-Sequence-Number: 5254 "Pavan Deolasee" writes: > On Wed, Mar 12, 2008 at 7:13 PM, Heikki Linnakangas > wrote: >> Yep, patch attached. I also changed xactGetCommittedChildren to return >> the original array instead of copying it, as Alvaro suggested. > Any comments on the flag based approach I suggested earlier ? I didn't like it; it seemed overly complicated (consider dealing with XID wraparound), and it would have problems with a slow transaction generating a sparse set of subtransaction XIDs. I think getting rid of the linear search will be enough to fix the performance problem. regards, tom lane