Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vi1vw-00067Z-T3 for pgsql-bugs@arkaria.postgresql.org; Sun, 17 Nov 2013 12:58:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Vi1vv-0001jW-OI for pgsql-bugs@arkaria.postgresql.org; Sun, 17 Nov 2013 12:58:35 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vi1vt-0001jN-N0 for pgsql-bugs@postgresql.org; Sun, 17 Nov 2013 12:58:33 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vi1vm-0000H5-DK for pgsql-bugs@postgresql.org; Sun, 17 Nov 2013 12:58:33 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by mahout.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vi1vj-0008QD-RI for pgsql-bugs@postgresql.org; Sun, 17 Nov 2013 12:58:26 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.80) (envelope-from ) id 1Vi1ve-0005cP-Ax for pgsql-bugs@postgresql.org; Sun, 17 Nov 2013 12:58:18 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: BUG #8598: Row count estimates of partial indexes To: pgsql-bugs@postgresql.org From: marko@joh.to Message-Id: Date: Sun, 17 Nov 2013 12:58:18 +0000 X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 8598 Logged by: Marko Tiikkaja Email address: marko@joh.to PostgreSQL version: 9.1.9 Operating system: Linux Description: Hi, We have the following partial index on a small subset of a larger table: "index_transactions_transaction_balance_details" btree (transactionid) WHERE NOT processed AND accountbalancesdailyid IS NOT NULL However, querying with the WHERE clause completely ignores the pg_class.reltuples value for the index: =# EXPLAIN ANALYZE SELECT * FROM transactions WHERE NOT processed AND accountbalancesdailyid IS NOT NULL; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Index Scan using index_transactions_transaction_balance_details on transactions (cost=0.00..3883160.47 rows=66259403 width=130) (actual time=0.033..18.268 rows=13962 loops=1) Total runtime: 18.874 ms (2 rows) .. which makes for some silly joins when this index is part of a larger query. Is this expected on 9.1? Has this been fixed in more recent versions? -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs