[Fwd: Re: [PERFORM] Seq scan on zero-parameters function]

Поиск
Список
Период
Сортировка
От Tomasz Myrta
Тема [Fwd: Re: [PERFORM] Seq scan on zero-parameters function]
Дата
Msg-id 40234227.7060209@klaster.net
обсуждение исходный текст
Список pgsql-sql
Dnia 2004-02-06 08:19, Użytkownik Octavio Alvarez napisał:
> Hi!
> 
>    I'd like to know if this is expected behavior. These are two couples of
> queries. In each couple, the first one has a WHERE field = function()
> condition, just like the second one, but in the form WHERE field =
> (SELECT function()). In my opinion, both should have the same execution
> plan, as the function has no parameters and, therefore, is constant.
Nope.

What would you say about function without params returning timeofday()?
Is it constant?

If you are sure, that your function returns constant value - declare it
as IMMUTABLE. (look at CREATE FUNCTION documentation)

Regards,
Tomasz Myrta




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

Предыдущее
От: "Mona H. Kapadia"
Дата:
Сообщение: unsubscribe
Следующее
От: Tomasz Myrta
Дата:
Сообщение: Re: [PERFORM] Seq scan on zero-parameters function