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 11438.1093899600@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Why does a simple query not use an obvious index?  (Greg Stark <gsstark@mit.edu>)
Ответы Re: Why does a simple query not use an obvious index?
Список pgsql-performance
Greg Stark <gsstark@mit.edu> writes:
> However I have the complementary reaction. I find peeking at the first
> bind parameter to be scary as hell. Functions seem slightly less scary.

FWIW, we only do it in the context of unnamed parameterized queries.
As the protocol docs say, those are optimized on the assumption that
they will be executed only once.  It seems entirely legitimate to me
to use the parameter values in such a case.

We might in future get braver about using sample parameter values,
but 8.0 is conservative about it.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: seqscan instead of index scan
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Why does a simple query not use an obvious index?