Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: java stored procedures fast, but slow when called as SQL function

Re: java stored procedures fast, but slow when called as SQL function

From: Richard Kuhler <noone_at_nowhere.com>
Date: Wed, 09 Apr 2003 19:10:10 GMT
Message-ID: <me_ka.34082$Hx.26505659@twister.socal.rr.com>


Noons wrote:
<liberal snips>
> Even in pure tight loops, I get it much slower...
> Then again, I've been writing PL/SQL for a LOT longer
> than I've been writing Java, so it's quite possibly me.

I think it's fair to say that Java is much faster at some things than non natively compiled PL/SQL is. Testing with a 'pure tight loop' on my box shows Java to be about 8 times faster. Pretty much any mathematical operation should be faster as well as simple string manipulations. Fortunately, I deal in a common real world environment where the SQL operations always dwarf the overhead of the computations that are necessary. The few cases where computation time was heavy were easily overcome with Native PL/SQL Compilation or a simple reorganization of how the computations were performed (to be more native SQL dependent).  

> > Except that you cannot use external Java as an SQL function.
>
> That's fine. PL/SQL will do fine there. Particularly with NCOMP.

It would be interesting to know if the original poster was using Native PL/SQL Compilation in his benchmarks.

> The writing is on the wall: beans and all the other
> J2EE stuff have been removed from the db JVM. Only basic
> Java functionality is still there.
> Largely for the benefit of those who have written a lot
> with it. And of those things that just cannot possibly
> be done with PL/SQL. Like sending e-mails from the db! ;)

I'm wondering if that winking emoticon is because you know this isn't true. You can send emails with UTL_SMTP including attachments using UTL_ENCODE. The number of things you can't do directly from PL/SQL seems to dwindle every day. That's a sure sign Oracle is going to get rid of it. ;)

Richard Received on Wed Apr 09 2003 - 14:10:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US