From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Michael Fork <mfork00(at)yahoo(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Planner Row Estimate with Function |
Date: | 2009-12-30 04:19:42 |
Message-ID: | 8614.1262146782@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Michael Fork <mfork00(at)yahoo(dot)com> writes:
>> Also, what happened to the type='CREDIT' condition in your query? Is
>> that a partial index?
> Yes, this is partial index. I should have included the index definition earlier:
Ah. The optimizer is ignoring the index stats on the grounds that
they are not representative of the whole table. I'm not entirely sure
offhand whether it would be safe to use them anyway if the index
predicate is known to match the query --- it seems a bit risky but on
the other hand it'd probably be better than having no stats at all.
What you can do to get a better estimate is to create a non-partial
index on parsecardidfromreferencecode(reference_code). It's fairly
likely that if you do that, maintaining the partial index as well
is not worth your time; but that's a decision you'd have to make.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Fork | 2009-12-30 05:29:36 | Re: Planner Row Estimate with Function |
Previous Message | Michael Fork | 2009-12-30 03:56:09 | Re: Planner Row Estimate with Function |