Re: Optimizing query?

Поиск
Список
Период
Сортировка
От Vincent Veyron
Тема Re: Optimizing query?
Дата
Msg-id 1359640830.2444.29.camel@asus-1001PX.home
обсуждение исходный текст
Ответ на Re: Optimizing query?  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Optimizing query?  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-general
Le jeudi 31 janvier 2013 à 11:06 +0100, Pavel Stehule a écrit :
> 2013/1/31 Vincent Veyron <vv.lists@wanadoo.fr>:
> >
> > Suppose I have a query of the form
> >
> > SELECT my_function(column_1), column_2
> > FROM my_table
> > GROUP BY my_function(column_1)
> > ORDER BY my_function(column_1);
> >
> > where my_function is a user defined function.
> >
> > How many times is the function computed?
>
> if function is stable or immutable, then once per row
>

In this post (watch for line-wrap) :

http://www.postgresql.org/message-id/CAFj8pRAdYL1-hCxH
+QSZQKHt9YnoaOiGkfX4cNc9mzUTimcs1w@mail.gmail.com

you wrote that it is usually better not to mark SQL functions (as
opposed to plpgsql functions).

So should I mark SQL functions stable/immutable if I use them in a query
like the one above, or is it unnecessary?


--
Salutations, Vincent Veyron
http://marica.fr/site/demonstration
Logiciel de gestion des contentieux juridiques et des sinistres d'assurance



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

Предыдущее
От: Torello Querci
Дата:
Сообщение: Re: Windows Phone/Postgresql
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Optimizing query?