Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 107AE9FA201 for ; Mon, 24 Sep 2007 15:21:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 96498-07 for ; Mon, 24 Sep 2007 15:21:27 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by postgresql.org (Postfix) with ESMTP id B2EDE9FA1F8 for ; Mon, 24 Sep 2007 15:21:27 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.1/8.14.1) with ESMTP id l8OILPL4031444 for ; Mon, 24 Sep 2007 15:21:25 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.1/8.14.1/Submit) id l8OIBWwx028783 for pgsql-performance@postgresql.org; Mon, 24 Sep 2007 15:11:32 -0300 (ADT) (envelope-from news) From: "Carlo Stonebanks" X-Newsgroups: pgsql.performance Subject: Re: REPOST: Nested loops row estimates always too high Date: Mon, 24 Sep 2007 14:12:01 -0400 Organization: Hub.Org Networking Services Lines: 40 Message-ID: References: <1190616376.17050.51.camel@neuromancer.home.net> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org In-Reply-To: <1190616376.17050.51.camel@neuromancer.home.net> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Windows Mail 6.0.6000.16480 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16480 To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/430 X-Sequence-Number: 26975 Has anyone offered any answers to you? No one else has replied to this post. "Ow Mun Heng" wrote in message news:1190616376.17050.51.camel@neuromancer.home.net... > On Thu, 2007-09-20 at 11:02 -0400, Carlo Stonebanks wrote: >> (SORRY FOR THE REPOST, I DON'T SEE MY ORIGINAL QUESTION OR ANY ANSWERS >> HERE) >> >> I am noticing that my queries are spending a lot of time in nested loops. >> The table/index row estimates are not bad, but the nested loops can be >> off >> by a factor of 50. In any case, they are always too high. >> >> Are the over-estimations below significant, and if so, is this an >> indication >> of a general configuration problem? > Sounds much like the issue I was seeing as well. > >> >> Unique (cost=67605.91..67653.18 rows=4727 width=16) (actual >> time=8634.618..8637.918 rows=907 loops=1) > > You can to rewrite the queries to individual queries to see it if helps. > > In my case, I was doing > > select a.a,b.b,c.c from > (select a from x where) a <--- Put as a SRF > left join ( > select b from y where ) b <--- Put as a SRF > on a.a = b.a > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend >