Re: get_actual_variable_range vs idx_scan/idx_tup_fetch

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: get_actual_variable_range vs idx_scan/idx_tup_fetch
Дата
Msg-id 20141018135810.GE25696@momjian.us
обсуждение исходный текст
Ответ на Re: get_actual_variable_range vs idx_scan/idx_tup_fetch  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: get_actual_variable_range vs idx_scan/idx_tup_fetch  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-hackers
On Fri, Oct 17, 2014 at 11:03:04PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > On Fri, Oct 17, 2014 at 06:15:37PM -0400, Tom Lane wrote:
> >> Those stats were perfectly valid: what the planner is looking for is
> >> accurate minimum and maximum values for the index's leading column, and
> >> that's what it got.  You're correct that a narrower index could have given
> >> the same results with a smaller disk footprint, but the planner got the
> >> results it needed from the index you provided for it to work with.
> 
> > Uh, why is the optimizer looking at the index on a,b,c and not just the
> > stats on column a, for example?  I am missing something here.
> 
> Because it needs up-to-date min/max values in order to avoid being
> seriously misled about selectivities of values near the endpoints.
> See commit 40608e7f949fb7e4025c0ddd5be01939adc79eec.

Oh, I had forgotten we did that.  It is confusing that there is no way
via EXPLAIN to see the access, making the method of consulting pg_stat_*
and using EXPLAIN unreliable.  Should we document this somewhere?

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +



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

Предыдущее
От: Nicolas Barbier
Дата:
Сообщение: Re: Materialized views don't show up in information_schema
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Code bug or doc bug?