Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id ADDD69FA514 for ; Tue, 25 Sep 2007 06:31:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 73308-07 for ; Tue, 25 Sep 2007 06:31:42 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by postgresql.org (Postfix) with ESMTP id 1C3C89FA51B for ; Tue, 25 Sep 2007 06:31:42 -0300 (ADT) Received: from trofast.ipv6.sesse.net ([2001:700:300:1803:20e:cff:fe36:a766] helo=trofast.sesse.net) by cassarossa.samfundet.no with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Ia6lS-0006w3-6a; Tue, 25 Sep 2007 11:31:36 +0200 Received: from root by trofast.sesse.net with local (Exim 4.67) (envelope-from ) id 1Ia6lR-00074Y-8C; Tue, 25 Sep 2007 11:31:33 +0200 Date: Tue, 25 Sep 2007 11:31:33 +0200 From: "Steinar H. Gunderson" To: Carlo Stonebanks Cc: 'Ow Mun Heng' , pgsql-performance@postgresql.org Subject: Re: REPOST: Nested loops row estimates always too high Message-ID: <20070925093133.GA27052@uio.no> Mail-Followup-To: Carlo Stonebanks , 'Ow Mun Heng' , pgsql-performance@postgresql.org References: <1190616376.17050.51.camel@neuromancer.home.net> <1190681440.22945.8.camel@neuromancer.home.net> <53877A06E07146D2898619A7025C6107@serenity> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <53877A06E07146D2898619A7025C6107@serenity> X-Operating-System: Linux 2.6.20.4 on a x86_64 X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ User-Agent: Mutt/1.5.16 (2007-06-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/436 X-Sequence-Number: 26981 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 :-) /* Steinar */ -- Homepage: http://www.sesse.net/