Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1baNns-0003mE-7W for pgsql-performance@arkaria.postgresql.org; Thu, 18 Aug 2016 13:56:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1baNnr-0003FT-QT for pgsql-performance@arkaria.postgresql.org; Thu, 18 Aug 2016 13:56:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1baNnr-0003Et-1L for pgsql-performance@postgresql.org; Thu, 18 Aug 2016 13:56:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1baNno-0007C3-5q for pgsql-performance@postgresql.org; Thu, 18 Aug 2016 13:56:14 +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 u7IDuAo9000767; Thu, 18 Aug 2016 09:56:10 -0400 From: Tom Lane To: Victor Yegorov cc: "pgsql-performance@postgresql.org" Subject: Re: Estimates on partial index In-reply-to: References: Comments: In-reply-to Victor Yegorov message dated "Thu, 18 Aug 2016 16:52:11 +0300" Date: Thu, 18 Aug 2016 09:56:10 -0400 Message-ID: <766.1471528570@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) 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 Victor Yegorov writes: > Settings: > random_page_cost 2.5 ¤ > seq_page_cost 1 ¤ > Question is — why IndexScan over partial index is estimated less than > BitmapHeap + BitmapIndex scan. And how can I tell Planner, that IndexScan > over 1/3 of table is not a good thing — IndexScan is touching 10x more > pages and in a typical situation those are cold. In that case you've got random_page_cost too far down. Values less than the default of 4 are generally only appropriate if the bulk of your database stays in RAM. 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