Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id A01459FA015 for ; Wed, 26 Sep 2007 00:50:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 36323-09 for ; Wed, 26 Sep 2007 00:50:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from wdscexfe02.sc.wdc.com (wdscexfe02.sc.wdc.com [129.253.170.52]) by postgresql.org (Postfix) with ESMTP id 6D8EC9F949E for ; Wed, 26 Sep 2007 00:50:53 -0300 (ADT) Received: from wdmyexbe03.my.asia.wdc.com ([129.253.105.55]) by wdscexfe02.sc.wdc.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 25 Sep 2007 20:50:39 -0700 Received: from 129.253.109.65 ([129.253.109.65]) by wdmyexbe03.my.asia.wdc.com ([129.253.105.55]) with Microsoft Exchange Server HTTP-DAV ; Wed, 26 Sep 2007 03:50:35 +0000 Received: from neuromancer by 129.253.105.55; 26 Sep 2007 11:50:46 +0800 Subject: Re: REPOST: Nested loops row estimates always too high From: Ow Mun Heng To: "Steinar H. Gunderson" Cc: Carlo Stonebanks , pgsql-performance@postgresql.org In-Reply-To: <20070925093133.GA27052@uio.no> References: <1190616376.17050.51.camel@neuromancer.home.net> <1190681440.22945.8.camel@neuromancer.home.net> <53877A06E07146D2898619A7025C6107@serenity> <20070925093133.GA27052@uio.no> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Wed, 26 Sep 2007 11:50:46 +0800 Message-Id: <1190778646.5402.16.camel@neuromancer.home.net> Mime-Version: 1.0 X-Mailer: Evolution 2.10.2 X-OriginalArrivalTime: 26 Sep 2007 03:50:39.0520 (UTC) FILETIME=[67642A00:01C7FFF0] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.014 tagged_above=0 required=5 tests=AWL=-0.313, BAYES_20=-0.74, RCVD_NUMERIC_HELO=2.067 X-Spam-Level: * X-Archive-Number: 200709/442 X-Sequence-Number: 26987 On Tue, 2007-09-25 at 11:31 +0200, Steinar H. Gunderson wrote: > On Tue, Sep 25, 2007 at 12:53:55AM -0400, Carlo Stonebanks wrote: > > My problem is that I think that SRF's are causing my problems. The SRF's > > gets an automatic row estimate of 1000 rows. Add a condition to it, the > > planner guesses 333 rows. Even at 333, this is an overestimate of the number > > of rows returned. > > > > I'm really disappointed - SRF's are a great way to place the enterprise's > > db-centric business logic at the server. > > Fortunately, in 8.3 you can attach a row estimate to the function yourself, > which should most likely fix your problem. Look forward to the first beta :-) > Where can I erad more about this new "feature"?