Re: Setting Statistics on Functional Indexes

Поиск
Список
Период
Сортировка
От Claudio Freire
Тема Re: Setting Statistics on Functional Indexes
Дата
Msg-id CAGTBQpbDZw3CVE9mgc_tS3a_ovjjg5YKnHQ=XrM89JNbaA9PvQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Setting Statistics on Functional Indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Setting Statistics on Functional Indexes
Список pgsql-performance
On Fri, Oct 26, 2012 at 6:08 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Interestingly, this is a case where the get_actual_variable_range patch
> (commit 40608e7f, which appeared in 9.0) makes the results worse.
> Before that, there was a (very arbitrary) lower bound on what we'd
> believe as the selectivity of a >= condition, but now, when we know the
> actual upper limit of the variable, we don't clamp the result that way.
> I think the clamp must have been saving you in your previous version,
> because it more-or-less-accidentally accounted for the end value not
> being unique.

IIRC, that patch was performing an index query (index_last) to get the
real largest value, right?

How many duplicates would you think the planner would require to
choose another (better) plan?

Because once you've accessed that last index page, it would be rather
trivial finding out how many duplicate tids are in that page and, with
a small CPU cost (no disk access if you don't query other index pages)
you could verify the assumption of near-uniqueness.


В списке pgsql-performance по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Setting Statistics on Functional Indexes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Setting Statistics on Functional Indexes