Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TjHul-0005xt-0Y for pgsql-performance@arkaria.postgresql.org; Thu, 13 Dec 2012 23:10:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TjHuj-0004KZ-9N for pgsql-performance@arkaria.postgresql.org; Thu, 13 Dec 2012 23:10:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TjHui-0004KT-9M for pgsql-performance@postgresql.org; Thu, 13 Dec 2012 23:10:00 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TjHue-00081i-Se for pgsql-performance@postgresql.org; Thu, 13 Dec 2012 23:09:59 +0000 X-Originating-IP: 217.70.178.139 Received: from mfilter10-d.gandi.net (mfilter10-d.gandi.net [217.70.178.139]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 73EEFA8076; Fri, 14 Dec 2012 00:09:46 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter10-d.gandi.net Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter10-d.gandi.net (mfilter10-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Ur5lR3S8eW5a; Fri, 14 Dec 2012 00:09:44 +0100 (CET) X-Originating-IP: 98.27.58.255 Received: from [192.168.10.146] (cpe-098-027-058-255.nc.res.rr.com [98.27.58.255]) (Authenticated sender: adsend@dunslane.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id DE6B7A8079; Fri, 14 Dec 2012 00:09:43 +0100 (CET) Message-ID: <50CA6036.6000107@dunslane.net> Date: Thu, 13 Dec 2012 18:09:42 -0500 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: Claudio Freire CC: AI Rumman , postgres performance list Subject: Re: Why does the number of rows are different in actual and estimated. References: <50CA586A.30008@dunslane.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 12/13/2012 05:42 PM, Claudio Freire wrote: > And it looks like it all may be starting to go south here: >> -> Hash Join (cost=9337.97..18115.71 rows=34489 width=244) (actual time=418.054..1156.453 rows=205420 loops=1) >> Hash Cond: (customerdetails.customerid = entity.id) Well, it looks like it's choosing a join order that's quite a bit different from the way the query is expressed, so the OP might need to play around with forcing the join order some. cheers andrew -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance