Re: Speed of different procedural language

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Speed of different procedural language
Дата
Msg-id 18610.1135223111@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Speed of different procedural language  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-performance
Michael Fuhr <mike@fuhr.org> writes:
> Try looping through two million rows with PL/Perl or PL/Tcl and
> you'll probably see significantly worse performance than with
> PL/pgSQL -- so much worse that I'd be surprised to see those languages
> make up the difference with whatever processing they'd be doing for
> each row unless it was something they're particularly good at and
> PL/pgSQL is particularly bad at.

I'd expect plpgsql to suck at purely computational tasks, compared to
the other PLs, but to win at tasks involving database access.  These
are two sides of the same coin really --- plpgsql is tightly tied to the
PG query execution engine, to the extent of using it even for simply
adding 2 and 2, but that also gives it relatively low overhead for
invoking a database query.  Perl, Tcl, et al have their own
computational engines and can easily beat the PG SQL engine for simple
arithmetic and string-pushing.  But they pay a high overhead for
calling back into the database engine.

            regards, tom lane

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

Предыдущее
От: Tom Arthurs
Дата:
Сообщение: Re: What's the best hardver for PostgreSQL 8.1?
Следующее
От: Qingqing Zhou
Дата:
Сообщение: Re: CPU and RAM