Re: Procedural Languages

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Zenaan Harkness <zen(at)freedbms(dot)net>
Cc: John Townsend <jtownsend(at)advancedformulas(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Procedural Languages
Date: 2012-06-08 06:08:59
Message-ID: 4FD196FB.9070407@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/08/2012 08:40 AM, Zenaan Harkness wrote:
> Will someone please point me to a URL re PG's Java backend cost.. been
> googling but no joy so far..
Benchmark it. It depends on your hardware, your workload, your JVM
version, your JVM vendor, your Java configuration, whether you have
pljava in your shared_preload_libraries, etc.
> I'd like find out how often the JVM starts up eg based on queries or
> sessions or connections or what... didn't know it was potentially
> woeful. In particular re "Because Pg doesn't re-use backends, there's
> a huge amount of JVM startup and shutdown cost."
>
"Huge" is relative; I'm just saying that it's a big cost relative to
PL/PgSQL. It may well be overstating the case.

Benchmark and see. In general, PL/Java should be cheaper if you have
longer-lived backends that do lots of work, and more expensive if you
have lots of short lived backends that run just one or two simple
PL/Java procedures then terminate.

Most PL/Java users are likely to be operating with connection pools
where connections are heavily re-used. The overhead of PL/Java may be
quite low in this case. Again, benchmark and see, but importantly
benchmark something comparable to your workload. There's no point
running a benchmark that's nothing like your workload and drawing
conclusions about your workload from it.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Manoj Agarwal 2012-06-08 09:30:15 Re: Problem while restoring a database from SQL_ASCII to UTF-8
Previous Message Craig Ringer 2012-06-08 05:39:22 Re: Question about load balance