Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a21Hl-0004xb-Hm for pgsql-performance@arkaria.postgresql.org; Thu, 26 Nov 2015 18:28:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a21Hk-0003OU-N7 for pgsql-performance@arkaria.postgresql.org; Thu, 26 Nov 2015 18:28:48 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a21FX-0003Kt-0Y for pgsql-performance@postgresql.org; Thu, 26 Nov 2015 18:26:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a21FU-00031c-JZ for pgsql-performance@postgresql.org; Thu, 26 Nov 2015 18:26:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id tAQIQRMs006787; Thu, 26 Nov 2015 13:26:27 -0500 From: Tom Lane To: Glyn Astill cc: Pgsql-performance Subject: Re: Index scan cost calculation In-reply-to: <412855216.18274544.1448560255082.JavaMail.yahoo@mail.yahoo.com> References: <31151.1448556291@sss.pgh.pa.us> <412855216.18274544.1448560255082.JavaMail.yahoo@mail.yahoo.com> Comments: In-reply-to Glyn Astill message dated "Thu, 26 Nov 2015 17:50:55 +0000" Date: Thu, 26 Nov 2015 13:26:27 -0500 Message-ID: <6786.1448562387@sss.pgh.pa.us> X-Pg-Spam-Score: -2.9 (--) 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 Glyn Astill writes: >> From: Tom Lane >> The problem will probably go away by itself as your table grows, but >> if you don't want to wait, you might want to reflect on which of the index >> columns might be (partially?) functionally dependent on the other columns, >> and whether you could redesign the key structure to avoid that. > Many thanks for the explanation, is such a functional dependency assumed purely based optimistically on statistics gathered by analyze? Well, the point is that the selectivities associated with the individual WHERE clauses are assumed independent, which allows us to just multiply them together. If they're not really independent then multiplication gives a combined selectivity that's too small. But without cross-column statistics there's not much we can do to get a better estimate. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance