Re: pl/pgsql functions outperforming sql ones?

Поиск
Список
Период
Сортировка
Искать
От
Pavel Stehule
Тема
Re: pl/pgsql functions outperforming sql ones?
Дата
Msg-id
CAFj8pRCceGDEp1sxvMoe0oaio6P=O2nJPfs9MWgu4-+zCTdrVg@mail.gmail.com
Ответ на
Список
Дерево обсуждения
pl/pgsql functions outperforming sql ones? "Carlo Stonebanks" <stonec.register@sympatico.ca>
Re: pl/pgsql functions outperforming sql ones? Merlin Moncure <mmoncure@gmail.com>
Re: pl/pgsql functions outperforming sql ones? "Carlo Stonebanks" <stonec.register@sympatico.ca>
Re: pl/pgsql functions outperforming sql ones? Deron <fecastle@gmail.com>
Re: pl/pgsql functions outperforming sql ones? "Carlo Stonebanks" <stonec.register@sympatico.ca>
Re: pl/pgsql functions outperforming sql ones? "A.M." <agentm@themactionfaction.com>
Re: pl/pgsql functions outperforming sql ones? Pavel Stehule <pavel.stehule@gmail.com>
Re: pl/pgsql functions outperforming sql ones? "Carlo Stonebanks" <stonec.register@sympatico.ca>
Re: pl/pgsql functions outperforming sql ones? Robert Haas <robertmhaas@gmail.com>
Re: pl/pgsql functions outperforming sql ones? "Carlo Stonebanks" <stonec.register@sympatico.ca>
Re: pl/pgsql functions outperforming sql ones? Pavel Stehule <pavel.stehule@gmail.com>
Re: pl/pgsql functions outperforming sql ones? "Carlo Stonebanks" <stonec.register@sympatico.ca>
Re: pl/pgsql functions outperforming sql ones? Pavel Stehule <pavel.stehule@gmail.com>
2012/1/27 Carlo Stonebanks :
> Yes, I did test it  - i.e. I ran the functions on their own as I had always
> noticed a minor difference between EXPLAIN ANALYZE results and direct query
> calls.
>
> Interesting, so sql functions DON'T cache plans? Will plan-caching be of any
> benefit to SQL that makes no reference to any tables? The SQL is emulating
> the straight non-set-oriented procedural logic of the original plpgsql.
>

It is not necessary usually - simple SQL functions are merged to outer
query - there are e few cases where this optimization cannot be
processed and then there are performance lost.

For example this optimization is not possible (sometimes) when some
parameter is volatile

Regards

Pavel Stehule
В списке pgsql-performance по дате отправления
От: Scott Marlowe
Дата:
От: Jayashankar K B
Дата:
FAQ