Re: Question on Index usage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Michael Monnerie <michael(dot)monnerie(at)is(dot)it-management(dot)at>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Question on Index usage
Date: 2009-01-21 15:25:38
Message-ID: 2116.1232551538@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Seems like the problem is that it is not pushing the "status IN"
> condition as part of the index condition for some reason, and instead
> using it as a filter. Maybe something to do with the selectivity of
> that clause?

No, AFAIR the planner will *always* include every possibly relevant
condition for a given index. If the condition is useless or nearly so,
that might prompt it to pick a different index instead, but not to omit
the indexqual. I'm thinking it's not believing it can use the status
condition with that index, perhaps for datatype reasons. What is status
declared as, exactly?

Also, what PG version is this?

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Merlin Moncure 2009-01-21 15:32:02 Re: [GENERAL] bytea size limit?
Previous Message Alvaro Herrera 2009-01-21 15:14:45 Re: autovacuum daemon