Re: Which is faster SQL or PL/PGSQL

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Which is faster SQL or PL/PGSQL
Дата
Msg-id 3F941A43.1040802@joeconway.com
обсуждение исходный текст
Ответ на Re: Which is faster SQL or PL/PGSQL  (Richard Huxton <dev@archonet.com>)
Ответы Re: Which is faster SQL or PL/PGSQL  (Richard Huxton <dev@archonet.com>)
Список pgsql-sql
Richard Huxton wrote:
> So - gain by not re-planning on every call, but maybe lose because your plan 
> is not so precise.
> 
> Of course, any queries you build dynamically and run via EXECUTE will have to 
> be planned each time.
> 

This question gets even more complex in 7.4, where many simple SQL 
functions will get inlined, and library preloading is available to speed 
that first PL/pgSQL call.

I think the best way to answer this question for any particular function 
is to try it both ways (if the function *can* be written as a SQL 
function) and see for yourself. And if you do this in 7.3, redo it when 
you upgrade to 7.4.

HTH,

Joe



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

Предыдущее
От: weigelt@metux.de
Дата:
Сообщение: Re: [postgres] PostgreSQL-DB auf Web-Schnittstelle bringen
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Scripting only the functions