pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <kgrittn@ymail.com>
To: marko@joh.to <marko@joh.to>
To: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #8598: Row count estimates of partial indexes
Date: Sun, 17 Nov 2013 07:34:10 -0800 (PST)
Message-ID: <1384702450.20685.YahooMailNeo@web162902.mail.bf1.yahoo.com> (raw)
In-Reply-To: <E1Vi1ve-0005cP-Ax@wrigleys.postgresql.org>
References: <E1Vi1ve-0005cP-Ax@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

"marko@joh.to" <marko@joh.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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (9+ messages)  latest in thread

Message-ID: <1384702450.20685.YahooMailNeo@web162902.mail.bf1.yahoo.com>
Permalink:  ../1384702450.20685.YahooMailNeo@web162902.mail.bf1.yahoo.com/
Also on:    postgresql.org/message-id/1384702450.20685.YahooMailNeo@web162902.mail.bf1.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: kgrittn@ymail.com, marko@joh.to
  Subject: Re: BUG #8598: Row count estimates of partial indexes
  In-Reply-To: <1384702450.20685.YahooMailNeo@web162902.mail.bf1.yahoo.com>
  References: <E1Vi1ve-0005cP-Ax@wrigleys.postgresql.org> <1384702450.20685.YahooMailNeo@web162902.mail.bf1.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox