Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id ED7C49F9480 for ; Mon, 3 Sep 2007 15:32:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 90372-05 for ; Mon, 3 Sep 2007 15:32:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by postgresql.org (Postfix) with ESMTP id 6AF289F945F for ; Mon, 3 Sep 2007 15:32:23 -0300 (ADT) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Mon, 03 Sep 2007 13:32:21 -0500 Message-Id: <46DC0CDD.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.2 Date: Mon, 03 Sep 2007 13:32:13 -0500 From: "Kevin Grittner" To: , "Shawn" Subject: Re: Slow Query References: <20070901102947.0c0a50a3@boffin.xmtservices.net> <22800.1188670194@sss.pgh.pa.us> <20070901131816.3f7ef91a@boffin.xmtservices.net> <20070901173519.0ed11401@boffin.xmtservices.net> <25184.1188702010@sss.pgh.pa.us> <20070903095749.5045211b@boffin.xmtservices.net> In-Reply-To: <20070903095749.5045211b@boffin.xmtservices.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/14 X-Sequence-Number: 26559 >>> On Mon, Sep 3, 2007 at 11:57 AM, in message <20070903095749.5045211b@boffin.xmtservices.net>, Shawn wrote:=20 > Also it runs a lot faster by itself =20 Given the context of the run, there is a possibility that a checkpoint = tends to fall at this point in the script because you're filling your WAL files. There is a known issue (which people have been working on fixing in 8.3) which causes the checkpoint to push a lot of pages to the disk and then = wait on physical writes. If the VACUUM ANALYZE doesn't turn up anything = useful, an interesting experiment would be to run your script with these modifications to your postgresql.conf file: =20 bgwriter_lru_percent =3D 20.0 # 0-100% of LRU buffers = scanned/round bgwriter_lru_maxpages =3D 200 # 0-1000 buffers max written/roun= d bgwriter_all_percent =3D 10.0 # 0-100% of all buffers = scanned/round bgwriter_all_maxpages =3D 600 # 0-1000 buffers max written/roun= d =20 Don't leave these in effect permanently without close attention to the overall impact. These settings have worked well for us, but are likely not to work well for everyone. =20 -Kevin =20