Re: General question about speed of functions

Поиск
Список
Период
Сортировка
От
Тема Re: General question about speed of functions
Дата
Msg-id c26c73073aca94ed2ba8b9eb905577af@mail.gransy.com
обсуждение исходный текст
Ответ на General question about speed of functions  (Brent Friedman <brent@brentfriedman.net>)
Список pgsql-general
On Tue, 13 Apr 2010 10:26:04 -0400, Brent Friedman
<brent@brentfriedman.net>
wrote:
> I am starting a project next week that looks like it will involve some
> massive sql rewrites to gain needed performance, and I am looking at
> implementing as many functions as possible.  I haven't worried that much
> about specific implementations in the past, but this project can use any
> performance gains available, so even a five percent difference between a
> function written in c vs pgsql would be helpful.
>
> The apparent choices available for the existing application are to use
> functions in pgsql, php or c.

This greatly depends on the type of processing you're doing. If you perform
a CPU intensive data processing (a lot of math applied to the data), the C
functions may give you tremendous performance gain.

But in most cases the processing consists of calls to the SQL engine and
simple processing of the results, so it will be about as fast as C (and
much easier to develop and maintain).

I have no experience with PL/PHP, but I'd say it will be about as fast as
PL/pgSQL ...

> Any comments about relative performance of using any of those languages
> would be greatly appreciated.

My recommendation is "Pay attention to properly design the schema, and
don't
hesitate to change it during development. Choose one of the languages and
stick with. And the money you save (due to development in a single
language)
invest into better hardware.

Tomas

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

Предыдущее
От: Grzegorz Jaśkiewicz
Дата:
Сообщение: Re: optimalisation with EXCEPT clause
Следующее
От: raghavendra t
Дата:
Сообщение: Re: Dynamic Catalog Views