Re: Performance PLV8 vs PLPGSQL

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Tim Uckun <timuckun(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Performance PLV8 vs PLPGSQL
Date: 2017-01-04 22:55:41
Message-ID: CAHyXU0yj7KEW2f+NQSnNgRyo=H6GF5mRDjs+VWQ9jK1qqtNRHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 28, 2016 at 3:15 AM, Tim Uckun <timuckun(at)gmail(dot)com> wrote:
> I have seen various links on the internet which indicate that PLV8 is
> significantly faster than PL-PGSQL sometimes an order of magnitude faster.
>
> Is this uniformly true or is it just in certain circumstances?
>
> Is there any benefit to choosing PL-PGSQL?
>
> Is there work going on to make PL-PGSQL more performant or has it gotten
> significantly faster in the last two years or so (some of the links are a
> from a while ago).

Pavel covered it pretty well but I'll chime in also. In typical usage
of pl/pgsql the overhead of the language itself is minimal. Most of
the heavy lifting is done by the SQL engine. pl/pgsql is glue that
sticks SQL statements together basically. Heavy computation in
pl/pgsql can be problematic but is rarely necessary. pl/v8 is
definitively a better choice for such cases but not being in core can
be an issue for some people.

The advantage of pl/pgsql is that SQL statements, types and errors are
native to the language itself. This makes many things much easier to
do...pl/pgsql is maybe the most efficient data processing language (in
terms of efficiency of coding) in existence. That may smack of
overstatement but my entire career is built around being good at it so
I'm inclined to effusiveness :-D.

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tomas Vondra 2017-01-05 00:08:25 Re: Performance degradation when using auto_explain
Previous Message Kisung Kim 2017-01-04 19:54:51 Re: Performance degradation when using auto_explain