Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 589CC632421 for ; Mon, 30 Aug 2010 04:25:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 85383-02 for ; Mon, 30 Aug 2010 07:25:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fep14.mx.upcmail.net (fep14.mx.upcmail.net [62.179.121.34]) by mail.postgresql.org (Postfix) with ESMTP id 584E4632291 for ; Mon, 30 Aug 2010 04:25:45 -0300 (ADT) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep14-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20100830072542.DKUD8381.viefep14-int.chello.at@edge04.upcmail.net>; Mon, 30 Aug 2010 09:25:42 +0200 Received: from wiesinger.com ([84.112.167.138]) by edge04.upcmail.net with edge id 0XRh1f02B2zVakc04XRiPo; Mon, 30 Aug 2010 09:25:42 +0200 X-SourceIP: 84.112.167.138 Received: from bbs.intern (localhost [127.0.0.1]) by wiesinger.com (8.14.4/8.14.4) with ESMTP id o7U7P1CT016184; Mon, 30 Aug 2010 09:25:01 +0200 Received: from localhost (gerhard@localhost) by bbs.intern (8.14.4/8.14.4/Submit) with ESMTP id o7U7P1Vf016171; Mon, 30 Aug 2010 09:25:01 +0200 Date: Mon, 30 Aug 2010 09:25:01 +0200 (CEST) From: Gerhard Wiesinger To: Scott Marlowe cc: pgsql-performance@postgresql.org Subject: Re: Major performance problem after upgrade from 8.3 to 8.4 In-Reply-To: Message-ID: References: User-Agent: Alpine 2.01 (LFD 1266 2009-07-14) MIME-Version: 1.0 X-MailScanner-Information-wiesinger-com: Please contact the ISP for more information X-wiesinger-com-MailScanner-ID: o7U7P1CT016184 X-MailScanner-wiesinger-com: Found to be clean X-MailScanner-SpamCheck-wiesinger-com: not spam, SpamAssassin (not cached, score=-4.399, required 4.5, autolearn=not spam, ALL_TRUSTED -1.80, BAYES_00 -2.60) X-MailScanner-From: lists@wiesinger.com X-Cloudmark-Analysis: v=1.1 cv=tsaDvxd5BMYuajhtvJLL+Ppe47iaIgCGP4JcOtoQkcg= c=1 sm=0 a=-BBt41PQAQkA:10 a=ORa4HqFjfvEA:10 a=-ProOGmuAAAA:8 a=nJ3bkVDLfpMPsPqmFSAA:9 a=01LYGX1lEcS0mVBRSDoA:7 a=CeeflE_uMzdGBUSFcpEkvvxm2QcA:4 a=wPNLvfGTeEIA:10 a=fU-A4pz3-wIA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT X-Archive-Number: 201008/311 X-Sequence-Number: 40154 On Mon, 30 Aug 2010, Scott Marlowe wrote: > On Mon, Aug 30, 2010 at 12:20 AM, Gerhard Wiesinger wrote: >> Hello, >> >> I just upgraded with pg_dump/restore from PostgreSQL 8.3.11 to 8.4.4 but I'm >> having major performance problems with a query with many left joins. Problem >> is that costs are now very, very, very high (was ok in 8.3). Analyze has >> been done. Indexes are of course there. >> >>  ->  Merge Left Join >> (cost=1750660.22..4273805884876845789194861338991916289697885665127154313046252183850255795798561612107149662486528.00 >> rows=238233578115856634454073334945297075430094545596765511255148896328828230572227215727052643001958400 >> width=16) >>        Merge Cond: (l.id = d2000903.fk_id) > > Wow! Other than an incredibly high cost AND row estimate, was the > query plan the same on 8.3 or different? > >> Details with execution plan can be found at: >> http://www.wiesinger.com/tmp/pg_perf_84.txt > > What's up with the "(actual time=.. rows= loops=) " in the explain analyze? What do you mean exactly? missing? I did it not with psql but with a GUI program. > >> I know that the data model is key/value pairs but it worked well in 8.3. I >> need this flexibility. >> >> Any ideas? > > Not really. I would like an explain analyze from both 8.3 and 8.4. > Are they tuned the same, things like work mem and default stats > target? I don't have a 8.3 version running anymore. But I'm havin an OLD version of a nearly exactly query plan (The sort was missing due to performance issues and it done now in a view, maybe also some more JOINS are added, but all that doesn't have impacts on the basic principle of the query plan): http://www.wiesinger.com/tmp/pg_perf.txt Tuning: Yes, on same machine with same parameters (manual diff on old config and added manually the parameters again). Thnx. Ciao, Gerhard -- http://www.wiesinger.com/