X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E8E7811F6D4A for ; Fri, 7 Apr 2006 16:02:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 35135-07 for ; Fri, 7 Apr 2006 16:02:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from pat.uio.no (pat.uio.no [129.240.10.6]) by postgresql.org (Postfix) with ESMTP id CA43611F6959 for ; Fri, 7 Apr 2006 16:02:11 -0300 (ADT) Received: from mail-mx6.uio.no ([129.240.10.47]) by pat.uio.no with esmtp (Exim 4.43) id 1FRwDg-0000e6-Qb; Fri, 07 Apr 2006 21:02:09 +0200 Received: from ti200710a080-3004.bb.online.no ([85.164.139.188] helo=[10.1.1.101]) by mail-mx6.uio.no with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.43) id 1FRwDZ-0004H1-P7; Fri, 07 Apr 2006 21:02:01 +0200 Subject: Re: Same SQL, 104296ms of difference between 7.4.12 and From: Rafael Martinez To: Tom Lane Cc: pgsql-performance@postgresql.org In-Reply-To: <14669.1144431418@sss.pgh.pa.us> References: <1144413933.24060.253.camel@bbking.uio.no> <12251.1144423772@sss.pgh.pa.us> <14669.1144431418@sss.pgh.pa.us> Content-Type: text/plain Organization: University of Oslo Date: Fri, 07 Apr 2006 21:04:51 +0200 Message-Id: <1144436691.6928.23.camel@linux.site> Mime-Version: 1.0 X-Mailer: Evolution 2.4.0 Content-Transfer-Encoding: 7bit X-UiO-Spam-info: not spam, SpamAssassin (score=-3.889, required 12, autolearn=disabled, AWL 1.11, UIO_MAIL_IS_INTERNAL -5.00) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200604/147 X-Sequence-Number: 18231 On Fri, 2006-04-07 at 13:36 -0400, Tom Lane wrote: > I wrote: > > Rafael Martinez Guerrero writes: > >> I have a sql statement that takes 108489.780 ms with 8.0.7 in a > >> RHEL4/amd64linux server with 2xAMD Opteron(tm) Processor 275 2.00GHz / > >> 8GB RAM and only 4193.588 ms with 7.4.12 in a RHEL3/386linux server with > >> 2xIntel(R) Xeon(TM) CPU 2.40GHz / 4GB RAM. > > > I think you've discovered a planner regression. > > Simplified test case using the regression database: > > > explain select * from tenk1 a, tenk1 b > > where (a.ten = b.ten and (a.unique1 = 100 or a.unique1 = 101)) > > or (a.hundred = b.hundred and a.unique1 = 42); > > I've repaired the assertion crash in 8.1/HEAD, but I don't think it's > practical to teach 8.0 to optimize queries like this nicely. The reason > 7.4 can do it is that 7.4 forces the WHERE condition into CNF, ie > [..................] Tom, thank you very much for your help. As I suspected this was a more complicated problem than the configuration of some parameters :( . Good that we have found out this now and not after the upgrade. All our upgrade plans and testing for all our databases have been done for/with 8.0.x (yes, I know 8.1.x is much better, but I am working in a conservative place from the sysadm point of view). We will have to change our plans and go for 8.1 if we want this to work. > My recommendation is to update to 8.1.4 when it comes out. Any idea about when 8.1.4 will be released? Thanks again. -- Rafael Martinez, Center for Information Technology Services University of Oslo, Norway PGP Public Key: http://folk.uio.no/rafael/