Re: plpgsql function is so slow

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: plpgsql function is so slow
Дата
Msg-id 29706.1253829299@sss.pgh.pa.us
обсуждение исходный текст
Ответ на plpgsql function is so slow  (Euler Taveira de Oliveira <euler@timbira.com>)
Ответы Re: plpgsql function is so slow  (Euler Taveira de Oliveira <euler@timbira.com>)
Список pgsql-hackers
Euler Taveira de Oliveira <euler@timbira.com> writes:
> I recently saw a complaint that a simple PL/PgSQL code is slower than PL/SQL.
> I did some benchmark and confirmed it is. I coded the same function
> (function2) in C just to compare with something. According to OP [1], the
> PL/SQL seems to run more than 15x faster than PL/PgSQL code.

Does incrementing an integer in a tight loop represent the complainant's
typical plpgsql workload?  If so, maybe he should go use another PL.
plpgsql is intended for work that involves a lot of database access, and
so the overhead in operations like this isn't significant.  We offer
other PLs that make different tradeoffs.

FWIW, the high showing of AllocSetReset in your profile suggests to me
that you're timing an assert-enabled build, which wouldn't exactly be
a fair comparison to an Oracle production build anyhow.
        regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: TODO item: Allow more complex user/database default GUC settings
Следующее
От: Joachim Wieland
Дата:
Сообщение: Patch for information_schema performance