dbTalk Databases Forums  

Bad performance calling stored procedures

comp.databases.oracle comp.databases.oracle


Discuss Bad performance calling stored procedures in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Robert Scheer
 
Posts: n/a

Default Bad performance calling stored procedures - 06-24-2004 , 03:18 PM






Hi.

I wrote some stored procedures used by a web application. As I am
fairly new to Oracle, I am missing some concepts when creating these
procedures, as a result, the application is suffering from poor
performance everytime I call these procedures. I would like your help
in order to identify potential mistakes when coding these procedures
and I am posting a package and a procedure I use very often on the
system, as an example:

CREATE OR REPLACE PACKAGE WebCursor AS
TYPE REF_CUR IS REF CURSOR;
END WebCursor;

CREATE OR REPLACE PROCEDURE appweb.GetUser (pLogin VARCHAR2, cUser OUT
WebCursor.REF_CUR)
AS
BEGIN
OPEN cUser FOR
SELECT name,login,email
FROM appweb.User
WHERE login = pLogin;
END GetUser;


Almost all the procedures return a cursor and some of them receives
input parameters. Can you help me to identify bad practices in my
code?

Thanks,
Robert Scheer

Reply With Quote
  #2  
Old   
hrishy
 
Posts: n/a

Default Re: Bad performance calling stored procedures - 06-24-2004 , 11:43 PM






Hi Robert

1)Try calling the refcursors from sql*plus itself and see if they are
running slow

2)How does this query perform in sql plus

SELECT name,login,email
FROM appweb.User
WHERE login = pLogin;


is it fast ? Do you have a index on login column ? if no then create a
index..

3)If the query is fast then you might have too lok at other things
like your asp pages webserver as the bottleneck might not be in the
database

regards
Hrishy

rbscheer (AT) my-deja (DOT) com (Robert Scheer) wrote in message news:<cfd22ab6.0406241218.7169b8ef (AT) posting (DOT) google.com>...
Quote:
Hi.

I wrote some stored procedures used by a web application. As I am
fairly new to Oracle, I am missing some concepts when creating these
procedures, as a result, the application is suffering from poor
performance everytime I call these procedures. I would like your help
in order to identify potential mistakes when coding these procedures
and I am posting a package and a procedure I use very often on the
system, as an example:

CREATE OR REPLACE PACKAGE WebCursor AS
TYPE REF_CUR IS REF CURSOR;
END WebCursor;

CREATE OR REPLACE PROCEDURE appweb.GetUser (pLogin VARCHAR2, cUser OUT
WebCursor.REF_CUR)
AS
BEGIN
OPEN cUser FOR
SELECT name,login,email
FROM appweb.User
WHERE login = pLogin;
END GetUser;


Almost all the procedures return a cursor and some of them receives
input parameters. Can you help me to identify bad practices in my
code?

Thanks,
Robert Scheer

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.