Re: Postgres Optimizer is not smart enough?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Postgres Optimizer is not smart enough?
Дата
Msg-id 9156.1105629851@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Postgres Optimizer is not smart enough?  (Mark Kirkwood <markir@coretech.co.nz>)
Список pgsql-performance
Mark Kirkwood <markir@coretech.co.nz> writes:
> Hmmm ... so it's only the selectivity that is the same (sourced from
> index->amcostestimate which I am guessing points to btcostestimate), is
> that correct?

No, the point is that btcostestimate will compute not only the same
selectivities but the identical index access cost values, because it
thinks that only one index entry will be fetched in both cases.  It
needs to account for the fact that the inequality condition will cause a
scan over a larger range of the index than is actually returned.  See
_bt_preprocess_keys() and _bt_checkkeys().

The small differences you are showing have to do with different
assumptions about where the now() function will get evaluated (once per
row or once at scan start).  That's not the effect that I'm worried
about.

            regards, tom lane

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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: PostgreSQL vs. Oracle vs. Microsoft
Следующее
От: William Yu
Дата:
Сообщение: Re: Increasing RAM for more than 4 Gb. using postgresql