Re: pl/pgsql functions outperforming sql ones?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: pl/pgsql functions outperforming sql ones?
Дата
Msg-id CAHyXU0wSjcc3vZ1__1wuUSmM1jrToMBAUj_5BErHda48oqZaoQ@mail.gmail.com
обсуждение исходный текст
Ответ на pl/pgsql functions outperforming sql ones?  ("Carlo Stonebanks" <stonec.register@sympatico.ca>)
Ответы Re: pl/pgsql functions outperforming sql ones?  ("Carlo Stonebanks" <stonec.register@sympatico.ca>)
Список pgsql-performance
On Thu, Jan 26, 2012 at 6:09 PM, Carlo Stonebanks
<stonec.register@sympatico.ca> wrote:
> Assuming there was some sort of cost to pl/pgsql, I rewrote a bunch of
> stored functions s in straight SQL. Each stored proc was calling the next,
> so to get the full effect I had to track down all the pl/pgsql stored
> functions and convert them to sql. However, I was surprised to find after
> all of the rewrites, the LANGUAGE sql procs caused the queries to run slower
> than the LANGUAGE plpgsql.

One reason that plpgsql can outperform sql functions is that plpgsql
caches plans.  That said, I don't think that's what's happening here.
Did you confirm the performance difference outside of EXPLAIN ANALYZE?
 In particular cases EXPLAIN ANALYZE can skew times, either by
injecting time calls or in how it discards results.

merlin

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

Предыдущее
От: Cédric Villemain
Дата:
Сообщение: Re: PostgreSQL Parallel Processing !
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Postgress is taking lot of CPU on our embedded hardware.