Re: function returning setof performance question

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: function returning setof performance question
Дата
Msg-id 3F2740A8.7020900@joeconway.com
обсуждение исходный текст
Ответ на Re: function returning setof performance question  (Mark Bronnimann <meb@speakeasy.net>)
Список pgsql-sql
Mark Bronnimann wrote:
>   I was hoping to eliminate the parse call on the view because I was doing 
> the where clause on the view instead of putting the where in the view. 
> In all, I was hoping to keep a single view called from multiple functions 
> with different where clauses. Yep... I shoulda known better...
> 

It sounds like you're using a sql function, not a plpgsql function 
(although I don't think you said either way). If you write the function 
in plpgsql it will get parsed and cached on the first call in a 
particular backend session, which *might* give you improved performance 
on subsequent calls, if there are any; are you using persistent connections?

Alternatively, it might work to use a prepared query.

Joe



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

Предыдущее
От: Mark Bronnimann
Дата:
Сообщение: Re: function returning setof performance question
Следующее
От: "Anagha Joshi"
Дата:
Сообщение: time precision.