Re: plpgsql functions vs. embedded queries

Поиск
Список
Период
Сортировка
От Wright, George
Тема Re: plpgsql functions vs. embedded queries
Дата
Msg-id 51548D6D5BEB57468163194A8C1A0E980161A5DF@MAGPTCPEXC02.na.mag-ias.net
обсуждение исходный текст
Ответ на Re: plpgsql functions vs. embedded queries  (John DeSoi <desoi@pgedit.com>)
Ответы Re: plpgsql functions vs. embedded queries  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
I did neither but will try both, thank you.

The functions took on average more than 10 times as long.


-----Original Message-----
From: John DeSoi [mailto:desoi@pgedit.com]
Sent: Monday, September 29, 2008 1:16 PM
To: Wright, George
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] plpgsql functions vs. embedded queries


On Sep 29, 2008, at 9:50 AM, Wright, George wrote:

> Are funtions in plpgsql always slower than embedding sql queries in
> string form in code like PHP?
> I ran several tests and they seemed to always perform that way. I
> would have thought the pre-planning would have made them faster.
> Would re-writing the functions C make them faster than the embedded
> queries?

I'd say no, they should not always be slower. Did you try preparing
your PHP call to the function? Did you mark your function as STABLE if
you are not modifying the database?


John DeSoi, Ph.D.





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

Предыдущее
От: John DeSoi
Дата:
Сообщение: Re: plpgsql functions vs. embedded queries
Следующее
От: Tom Lane
Дата:
Сообщение: Re: plpgsql functions vs. embedded queries