Re: Bad plan when join on function

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Bad plan when join on function
Дата
Msg-id 4D34576C02000025000396CB@gw.wicourts.gov
обсуждение исходный текст
Ответ на Bad plan when join on function  (Zotov <zotov@oe-it.ru>)
Ответы Re: Bad plan when join on function  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-performance
Zotov  wrote:

> select c.id from OneRow c join abstract a on a.id=AsInteger(c.id)

> Why SeqScan???

Because you don't have an index on AsInteger(c.id).

If your function is IMMUTABLE (each possible combination of input
values always yields the same result), and you declare it such, then
you can index on the function, and it will perform at a speed similar
to the other example.

-Kevin

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Possible to improve query plan?
Следующее
От: Jeremy Palmer
Дата:
Сообщение: Re: Possible to improve query plan?