Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id D7B48B5DC2B for ; Sun, 30 Oct 2011 23:36:38 -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 98882-03 for ; Mon, 31 Oct 2011 02:36:28 +0000 (UTC) X-Greylist: delayed 00:06:01.782087 by SQLgrey-1.8.0-rc2 Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.216.181]) by mail.postgresql.org (Postfix) with ESMTP id 5AF45B5DC32 for ; Sun, 30 Oct 2011 23:36:28 -0300 (ADT) Received: by qyk27 with SMTP id 27so5878839qyk.19 for ; Sun, 30 Oct 2011 19:36:28 -0700 (PDT) Received: by 10.229.67.156 with SMTP id r28mr2562864qci.88.1320028224973; Sun, 30 Oct 2011 19:30:24 -0700 (PDT) Received: from [192.168.0.105] (125-237-67-169.jetstream.xtra.co.nz. [125.237.67.169]) by mx.google.com with ESMTPS id gc8sm19177061qab.4.2011.10.30.19.30.22 (version=SSLv3 cipher=OTHER); Sun, 30 Oct 2011 19:30:24 -0700 (PDT) Subject: Re: BUG #6275: Horrible performance regression From: Finlay Thompson To: Tom Lane Cc: pgsql-bugs@postgresql.org In-Reply-To: <13998.1319777593@sss.pgh.pa.us> References: <201110280242.p9S2gdRI054867@wwwmaster.postgresql.org> <13998.1319777593@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Date: Mon, 31 Oct 2011 15:30:19 +1300 Message-ID: <1320028219.10204.23.camel@frank.dragonfly.co.nz> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 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: 201110/305 X-Sequence-Number: 31575 Hi Tom Sorry for the delay. The version of postgis didn't change, and when I rolled back to postgresql 8.4.9 the expected performance returned. I am very confident the regression was caused by the 8.4.9 upgrade. Any suggestions on how to diagnose a long run script like this ? I can easily turn on more logging, in both cases and compare ? Can I log the query plans ? Finlay On Fri, 2011-10-28 at 00:53 -0400, Tom Lane wrote: > "Finlay Thompson" writes: > > After an upgrade from 8.4.8 to 8.4.9 performance of load script went from ~ > > 3 hours to not finishing after 24 hours. > > > Context: We have a continuous build script, that loads, grooms, matches data > > every few hours. The script has been run over 100 times in the last few > > weeks, and has steadily been taking around 3 hours. It is really a group of > > scripts, something like 15000 lines of sql, and some python scripts to run > > it together. > > > After upgrading the postgresql*-8.4 packages on ubuntu, to version 8.4.9, > > the script suddenly stopped working, and consuming all the ram (16GB) on the > > computer (i7). > > Well, the most likely theory seems to be that one of the planner changes > in 8.4.9 is resulting in a much less optimal plan choice for one or more > queries, but it's impossible to diagnose it on the basis of this much > information. > > > btw: The database uses plpython and postgis. > > Hmm, did you change postgis versions at the same time? If so, which > upgrade caused the problem, postgres or postgis? > > regards, tom lane -- Finlay Thompson www.dragonfly.co.nz Dragonfly, PO Box 27535, Wellington 6141, New Zealand Level 5, 158 Victoria Street, Te Aro, Wellington M: +64 21 426 878 T: +64 4 385 9285