Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id A7B19632EFE for ; Fri, 16 Apr 2010 10:21:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 63478-09 for ; Fri, 16 Apr 2010 13:21:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ww0-f46.google.com (mail-ww0-f46.google.com [74.125.82.46]) by mail.postgresql.org (Postfix) with ESMTP id 082FF6325AF for ; Fri, 16 Apr 2010 10:21:23 -0300 (ADT) Received: by wwb24 with SMTP id 24so1145054wwb.19 for ; Fri, 16 Apr 2010 06:21:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=ilEkzHcnmH50uTj5ZZAX+mkNZS35mhm8aG5MMNidLOc=; b=Vgl3pFi2sdraymSLP2Zeis+Hrvb0ZlMPRoImKQTcLVViyrgpEC7ZZX5cLnC35Wc2Ss sA0N//IM6o7OqmgJdzdA3agQpUTaDgM9SwcXfjheLFtKlJsTYLvPozDQAfQG+VwJbIVr JunHxkahPlRWo/AZx7EkBspowpSDyHeYHm9Bs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=wF4spuRG4Nl3XjjEpnN0t5X3z5qEADl8jMO/0Aa22MOlqPdNBc7IeU2/V+0qSf5phy /eQUri8YoFpX87hvdKyy/jfFm3IR/hwiSFgYEXrSnriMOKzYyw26zCq+T2FY87PZvpNY dZ4Zp2SYlh2aCxyeRbiqm8ZrTtf4uxJFtBpB4= Received: by 10.216.91.76 with SMTP id g54mr1903116wef.2.1271424081926; Fri, 16 Apr 2010 06:21:21 -0700 (PDT) Received: from [0.0.0.0] (5357DA75.cable.casema.nl [83.87.218.117]) by mx.google.com with ESMTPS id r29sm20987800wbv.9.2010.04.16.06.21.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 16 Apr 2010 06:21:21 -0700 (PDT) Message-ID: <4BC8645A.2060700@gmail.com> Date: Fri, 16 Apr 2010 15:21:30 +0200 From: Yeb Havinga User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: =?KOI8-U?Q?=F7=A6=D4=C1=CC=A6=CA_=F4=C9=CD=DE=C9=DB=C9=CE?= CC: pgsql-performance@postgresql.org Subject: Re: Planner not using column limit specified for one column for another column equal to first References: <4BC8204A.7050904@gmail.com> In-Reply-To: Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.315 tagged_above=-10 required=5 tests=BAYES_40=-0.001, FREEMAIL_FROM=0.001, SARE_MILLIONSOF=0.315 X-Spam-Level: X-Archive-Number: 201004/202 X-Sequence-Number: 38452 ÷¦ÔÁÌ¦Ê ôÉÍÞÉÛÉÎ wrote: > > BTW: Changing slow query to inner joins do not make it fast I'm interested to see the query andplan of the slow query with inner joins. > > > Another thing is it seems that the number of rows guessed is far > off from the actual number of rows, is the number 5000000 > artificial or are you're statistics old or too small histogram/mcv's? > > > Nope, I suppose this is because of limit. If I remove the limit, the > estimations are quite correct. There are ~6 millions of row in each table. Yes, that makes sense. regards, Yeb Havinga