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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL Performance

Re: PL/SQL Performance

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1998/05/18
Message-ID: <35603d70.5155963@192.86.155.100>#1/1

A copy of this was sent to Lynn Ranen <ranen_at_ix.netcom.com> (if that email address didn't require changing) On Sat, 16 May 1998 21:19:27 +0100, you wrote:

>Hi All --
>
>I’m still having an uphill battle with performance issues. Last week, I
>posted for help with a “long query”. Since then, I have looked harder at the
>issue and find that overall performance is horrible and completely
>unacceptable. Frankly, I can’t believe that the level of performance I am
>seeing could be considered acceptable by a company that did over $6 billion
>in sales last year.
>
>Therefore, I must assume that something is terribly wrong with the system.
>
>I developed a benchmarking package to time and record every function call in
>the most troublesome procedure. After noticing that most function/procedure
>calls (except those accessing DB tables) took about 0.40 seconds, I became
>suspicious. I decided to devise a “foolproof” test to see what is REALLY
>going on. The variable assignment,
> FOO := 1; where FOO is a NUMBER,
>also takes between 0.40 and 2.47 seconds. Unbelievable!!! Imagine how this
>affects the entire application when it’s stuck inside of a 900 iteration
>loop.
>

I went and found the slowest machine I could to try the same on. A single 50mhz sparc running oracle7.1, 7.2, 7.3, 8.0, and 8.1 with 64m of RAM installed.

I ran:

$ sqlplus tkyte/tkyte

SQL*Plus: Release 3.3.3.0.0 - Production on Mon May 18 09:38:29 1998 Copyright (c) Oracle Corporation 1979, 1996. All rights reserved.

Connected to:
Oracle7 Server Release 7.3.3.0.0 - Production Release With the distributed, replication, parallel query and Spatial Data options PL/SQL Release 2.3.3.0.0 - Production

SQL> set timing on
SQL> declare
  2 foo number;
  3 begin
  4 foo := 1;
  5 end;
  6 /
PL/SQL procedure successfully completed. Elapsed: 00:00:00.06
SQL> /
PL/SQL procedure successfully completed. Elapsed: 00:00:00.01
SQL> /
PL/SQL procedure successfully completed. Elapsed: 00:00:00.01
SQL> /
PL/SQL procedure successfully completed. Elapsed: 00:00:00.01
SQL> /
PL/SQL procedure successfully completed. Elapsed: 00:00:00.01
SQL> /
PL/SQL procedure successfully completed. Elapsed: 00:00:00.01

So, the first time it ran, it took 6/100's of a second (had to parse and compile the code the first time around and all). Each subsequent time took 1/100's of a second.

So I agree with your comment that something with your system is very wrong. You could have saved yourself LOTS of time 'timing' everything if you would have used TKPROF to analyze statistics generated by the database.

Here is a couple of things you need to do:

>This is Oracle 7.3.x running on Solaris. Last week we quadrupled the RAM and
>added another CPU. Neither of these had any affect on the times recorded.
>I’ve timed and tuned EVERY call to the DB. the customer is very unhappy and
>won’t even use the product (sound familiar?).
>

Not really, how did you tune the queries? do you use "sql_trace=true", "timed_statistics=true" and tkprof? You say you tuned every call to the DB, How?

>Has anyone performed similar benchmark tests? How were you’re times? I am
>thinking to upgrade to Oracle 8 and just forget the whole issue. Will this
>help me? My company just got a $10 million contract and I am REALLY hesitant
>to develop another product on Oracle if this is the performance I can
>expect. Any and all feedback appreciated.
>
>Lynn
>PS: for those who are interested or assisted me with query advice. Time
>results follow.
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Mon May 18 1998 - 00:00:00 CDT

Original text of this message

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