Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 5C55C632D34 for ; Fri, 3 Sep 2010 16:35:07 -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 29101-09 for ; Fri, 3 Sep 2010 19:34:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fep16.mx.upcmail.net (fep16.mx.upcmail.net [62.179.121.36]) by mail.postgresql.org (Postfix) with ESMTP id 72456632694 for ; Fri, 3 Sep 2010 16:34:55 -0300 (ADT) Received: from edge02.upcmail.net ([192.168.13.237]) by viefep16-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20100903193453.IMRJ1503.viefep16-int.chello.at@edge02.upcmail.net>; Fri, 3 Sep 2010 21:34:53 +0200 Received: from wiesinger.com ([84.112.167.138]) by edge02.upcmail.net with edge id 2Kap1f04q2zVakc02KarYv; Fri, 03 Sep 2010 21:34:53 +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 o83JYCsd024161; Fri, 3 Sep 2010 21:34:12 +0200 Received: from localhost (gerhard@localhost) by bbs.intern (8.14.4/8.14.4/Submit) with ESMTP id o83JYCVN024157; Fri, 3 Sep 2010 21:34:12 +0200 Date: Fri, 3 Sep 2010 21:34:12 +0200 (CEST) From: Gerhard Wiesinger To: Tom Lane cc: Pavel Stehule , Andreas Kretschmer , pgsql-performance@postgresql.org Subject: Re: Major performance problem after upgrade from 8.3 to 8.4 In-Reply-To: <27253.1283539468@sss.pgh.pa.us> Message-ID: References: <20100830072230.GA28373@tux> <11111.1283185373@sss.pgh.pa.us> <12837.1283186981@sss.pgh.pa.us> <21281.1283433278@sss.pgh.pa.us> <22001.1283523290@sss.pgh.pa.us> <24994.1283532424@sss.pgh.pa.us> <25560.1283534215@sss.pgh.pa.us> <26620.1283537362@sss.pgh.pa.us> <27253.1283539468@sss.pgh.pa.us> User-Agent: Alpine 2.01 (LFD 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-MailScanner-Information-wiesinger-com: Please contact the ISP for more information X-wiesinger-com-MailScanner-ID: o83JYCsd024161 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=KBHyIoyMIRH440NzHl6uMYpbxJngTLC2P1JzLC/QbPg= c=1 sm=0 a=-BBt41PQAQkA:10 a=ORa4HqFjfvEA:10 a=kj9zAlcOel0A:10 a=-ProOGmuAAAA:8 a=7GDZiFtVvCIbvwVfby8A:9 a=Jef-BfR_gMV8Twl3algA:7 a=LqRQiAn7tKEXGDQS2ufyVV-EeRAA:4 a=CjuIK1q_8ugA: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: X-Archive-Number: 201009/20 X-Sequence-Number: 40223 On Fri, 3 Sep 2010, Tom Lane wrote: > Gerhard Wiesinger writes: >> On Fri, 3 Sep 2010, Tom Lane wrote: >>> I think what may be happening here is that a postgres executable expects >>> to find itself in a full installation tree, ie if it's in /someplace/bin >>> then the timezone files are in /someplace/share, etc. Did you do a full >>> "make install" after building, or did you just copy the postgres >>> executable? > >> I just copied it as discussed in the original mail to avoid that make >> install kills the 8.4 production RPM version: >> cp ./src/backend/postgres /bin/postgres-8.3.11 > > Definitely not going to work. Instead, configure with --prefix set > to /someplace/harmless, make, make install, execute from > /someplace/harmless/bin/. Thanks tom, your support for PostgreSQL is really very, very good. Install: ./configure --prefix /opt/postgres-8.3 make make install su -l postgres -c "/opt/postgres-8.3/bin/postgres -p 54321 -D /var/lib/pgsql-old/data &" >> /var/lib/pgsql-old/pgstartup.log 2>&1 < /dev/null Back to the original problem: 8.3 query plans: http://www.wiesinger.com/tmp/pg_perf_83_new.txt 8.4 quey plans: http://www.wiesinger.com/tmp/pg_perf_84.txt Main difference as I saw: 8.3: -> Nested Loop Left Join (cost=0.00..1195433.19 rows=67 width=16) 8.4: -> Merge Left Join (cost=1750660.22..4273805884876845789194861338991916289697885665127154313046252183850255795798561612107149662486528.00 rows=238233578115856634454073334945297075430094545596765511255148896328828230572227215727052643001958400 width=16) Any ideas why? How to fix? Thnx. Ciao, Gerhard -- http://www.wiesinger.com/