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. Are they slower than PL/SQL?

Re: Java stored procedures. Are they slower than PL/SQL?

From: Pete Finnigan <pete_at_peterfinnigan.demon.co.uk>
Date: Thu, 4 Oct 2001 09:51:10 +0100
Message-ID: <MtlmjZA+LCv7EwuB@peterfinnigan.demon.co.uk>


Hi Sybrand

PL/SQL is also not compiled to native code, it is also compiled to an intermediate code and executed by the PL/SQL interpreter. I dont know exactly how it works internal, hence i shy from using 'P' code in the same sense as java does. I know PL/SQL is based on ADA and uses internal DIANA representations. In terms of how they work the java and PL/SQL are both interpreted.

I dont know much about the java stuff yet as i have not had time to play with it in depth but one reason the PL/SQL could be faster is that large chunks of it are in fact written in 'C', as are chunks of the SQL implementation. Oracle make calls out to 'C' routines from the PL/SQL using the PRAGMA INTERFACE (C,some_c_function) syntax. I suspect that the Java makes less use of the direct C calls.

Just a thought

regards

Pete Finnigan
www.pentest-limited.com

In article <trnn3ekoo8sh7c_at_news.demon.nl>, Sybrand Bakker <postbus_at_sybrandb.demon.nl> writes
>
>"Don Chambers" <dchamber_at_mindspring.com> wrote in message
>news:4bfnrt4k1kgkv1rhp452v62n4ermejtjur_at_4ax.com...
>> I have created my first java stored procedure and it seems very slow.
>> I use it to move a large amount from a load table to main tables. In
>> a previous design we used PL/SQL procs and this load took about 8
>> hours. Based on the number of rows that loaded before I left tonight
>> it looks like the JAVA proc will take over 20 hours. Why the HUGE
>> difference?
>>
>> Is there a way to speed this up?
>> Are the java procs compiled or do they use the just in time compiler?
>>
>> Thanks,
>> Don
>
>Java procs are, AFAIK, *not* compiled, and if they are compiled, they are
>compiled to so-called p-code (pseudo-code), which is machine independent,
>and still would need the JVM to run.
>So, yes, by design Java stored procedures are slower than their
>corresponding pl/sql equivalents, due to the nature of Java.
>The only way to speed that up is not to use them everywhere, and not to fall
>victim to the Java hype.
>
>Regards,
>
>Sybrand Bakker, Senior Oracle DBA
>
>
>

-- 
Pete Finnigan
IT Security Consultant
PenTest Limited

Office  01565 830 990
Fax     01565 830 889
Mobile  07974 087 885

pete.finnigan_at_pentest-limited.com

www.pentest-limited.com
Received on Thu Oct 04 2001 - 03:51:10 CDT

Original text of this message

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