Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 94801B5DBE0 for ; Wed, 3 Aug 2011 13:31:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 52289-06 for ; Wed, 3 Aug 2011 16:31:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og121.obsmtp.com (exprod7og121.obsmtp.com [64.18.2.20]) by mail.postgresql.org (Postfix) with ESMTP id 1BB50B5DBDB for ; Wed, 3 Aug 2011 13:31:26 -0300 (ADT) Received: from mail-fx0-f49.google.com ([209.85.161.49]) (using TLSv1) by exprod7ob121.postini.com ([64.18.6.12]) with SMTP ID DSNKTjl33qGFdjUqih1Yj34mrtRXmiBVBao5@postini.com; Wed, 03 Aug 2011 09:31:27 PDT Received: by mail-fx0-f49.google.com with SMTP id 20so1386628fxd.36 for ; Wed, 03 Aug 2011 09:31:26 -0700 (PDT) Received: by 10.223.97.134 with SMTP id l6mr2542519fan.10.1312389085985; Wed, 03 Aug 2011 09:31:25 -0700 (PDT) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id h17sm85339fai.14.2011.08.03.09.31.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 03 Aug 2011 09:31:22 -0700 (PDT) Message-ID: <4E3977D8.1020506@enterprisedb.com> Date: Wed, 03 Aug 2011 19:31:20 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.2.18) Gecko/20110626 Icedove/3.1.11 MIME-Version: 1.0 To: Alexander Korotkov CC: pgsql-hackers Subject: Re: WIP: Fast GiST index build References: <4E1DA4CB.9020209@enterprisedb.com> <4E1EABD9.5000308@enterprisedb.com> <4E1F5763.9090109@enterprisedb.com> <4E2DBB60.80604@enterprisedb.com> <4E2EF83A.8000304@enterprisedb.com> <4E31D03D.70206@enterprisedb.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201108/127 X-Sequence-Number: 192882 On 03.08.2011 11:18, Alexander Korotkov wrote: > I found that in previous version of patch I missed PageSetLSN > and PageSetTLI, but huge amount of WAL is still here. Also I found that huge > amount of WAL appears only with -O2. With -O0 amount of WAL is ok, but > messages "FATAL: xlog flush request BFF11148/809A600 is not satisfied --- > flushed only to 44/9C518750" appears. Seems that there is some totally wrong > use of WAL if even optimization level does matter... Try this: diff --git a/src/backend/access/gist/gistbuild.c b/src/backend/access/gist/gistbuild.c index 5099330..5a441e0 100644 --- a/src/backend/access/gist/gistbuild.c +++ b/src/backend/access/gist/gistbuild.c @@ -478,7 +478,7 @@ bufferingbuildinsert(GISTInsertState *state, /* Write the WAL record */ if (RelationNeedsWAL(state->r)) { - gistXLogUpdate(state->r->rd_node, buffer, oldoffnum, noldoffnum, + recptr = gistXLogUpdate(state->r->rd_node, buffer, oldoffnum, noldoffnum, itup, ntup, InvalidBuffer); PageSetLSN(page, recptr); PageSetTLI(page, ThisTimeLineID); -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com