Re: Procedural Languages - Mailing list pgsql-general

From Craig Ringer
Subject Re: Procedural Languages
Date
Msg-id 4FD196FB.9070407@ringerc.id.au
Whole thread Raw
In response to Re: Procedural Languages  (Zenaan Harkness <zen@freedbms.net>)
List 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

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Question about load balance
Next
From: "Marc Watson"
Date:
Subject: Re: Postgres 9.2 beta2 one-click installer on windows