Re: optimizer choosing the wrong index

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Martin Below <machtin.below@googlemail.com>
Cc: pgsql-general@postgresql.org
Date: 2010-07-08T14:11:30Z
Lists: pgsql-general
Martin Below <machtin.below@googlemail.com> writes:
> test=# select count(*) total, count(distinct client_id) ids,
> count(distinct expires_on) dates from ps;
>  total  |  ids   | dates
> --------+--------+--------
>  213645 | 123366 | 213549

That says the expires_on column is practically unique, which makes me
think the planner is indeed making the right choice.

			regards, tom lane