Re: Why does a simple query not use an obvious index?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why does a simple query not use an obvious index?
Дата
Msg-id 18966.1093832636@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Why does a simple query not use an obvious index?  (Mr Pink <mr_pink_is_the_only_pro@yahoo.com>)
Ответы Re: Why does a simple query not use an obvious index?
Список pgsql-performance
Mr Pink <mr_pink_is_the_only_pro@yahoo.com> writes:
>>> AFAIK postgres doesn't peek at values used in a query when optimizing
>>
>> Of course it does.

> But not ones returned by a function such as now(), or when you use
> bind variables, as Tom aptly explained.

FWIW, 8.0 does have the ability to use the values of bind variables for
planning estimation (Oliver Jowett did the work for this).  The main
issue in the way of dealing with now() is that whatever we did to now()
would apply to all functions marked "stable", and it's a bit
nervous-making to assume that they should all be treated this way.
Or we could introduce more function volatility categories, but that's
not much fun either.

            regards, tom lane

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

Предыдущее
От: Mr Pink
Дата:
Сообщение: Re: Why does a simple query not use an obvious index?
Следующее
От: Mr Pink
Дата:
Сообщение: Re: Why does a simple query not use an obvious index?