Re: BUG #8598: Row count estimates of partial indexes

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: "marko(at)joh(dot)to" <marko(at)joh(dot)to>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #8598: Row count estimates of partial indexes
Date: 2013-11-17 15:34:10
Message-ID: 1384702450.20685.YahooMailNeo@web162902.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"marko(at)joh(dot)to" <marko(at)joh(dot)to> wrote:

>   "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:

What is the pg_class.reltuples value for the index?

> =# EXPLAIN ANALYZE SELECT * FROM transactions WHERE NOT processed
> AND accountbalancesdailyid IS NOT NULL;

> 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)

> .. 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?

Please provide a little more information:

SELECT version();
SELECT name, current_setting(name), source
  FROM pg_settings
  WHERE source NOT IN ('default', 'override');

What VACUUM or ANALYZE commands are run outside of autovacuum?

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2013-11-17 16:29:15 Re: BUG #8598: Row count estimates of partial indexes
Previous Message marko 2013-11-17 12:58:18 BUG #8598: Row count estimates of partial indexes