Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 2EBD36508E8 for ; Sun, 20 Jul 2008 01:51:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 48562-02-6 for ; Sun, 20 Jul 2008 01:51:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 373C5650689 for ; Sun, 20 Jul 2008 01:44:57 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m6K4ilGx024819; Sun, 20 Jul 2008 00:44:48 -0400 (EDT) To: Daniele Varrazzo cc: Francisco Reyes , pgsql-performance@postgresql.org Subject: Re: An "obvious" index not being used In-reply-to: <488222A7.1000202@develer.com> References: <4859B13F.3070103@develer.com> <10923.1213839814@sss.pgh.pa.us> <4859C24F.6000503@develer.com> <488222A7.1000202@develer.com> Comments: In-reply-to Daniele Varrazzo message dated "Sat, 19 Jul 2008 18:21:43 +0100" Date: Sun, 20 Jul 2008 00:44:47 -0400 Message-ID: <24818.1216529087@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/163 X-Sequence-Number: 30763 Daniele Varrazzo writes: > In my problem I had 2 tables: a small one (accounts), a large one (foo). The > way the query is written doesn't allow the stats from the large table to be > used at all, unless the records from the small table are fetched. This is > independent from the stats accuracy. > What the planner does is to assume an even distribution in the data in the > joined fields. Sir, you don't know what you're talking about. regards, tom lane