On 06/08/2012 08:40 AM, Zenaan Harkness wrote:
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.Will someone please point me to a URL re PG's Java backend cost.. been googling but no joy so far.. "Huge" is relative; I'm just saying that it's a big cost relative to PL/PgSQL. It may well be overstating the case.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." 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 |