473,395 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Bad performance calling stored procedures

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
Jul 19 '05 #1
1 4347
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

rb******@my-deja.com (Robert Scheer) wrote in message news:<cf**************************@posting.google. com>...
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

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jason | last post by:
I have a function which performs a query and returns a table. The one parameter that can get passed in is a date which defaults to NULL. There is an IF statement in the function that will set the...
1
by: ZeBerg | last post by:
Is it possible to have a stored procedure in database A while calling it from database B and have it manipulate the tables in database B (whatever the calling database happens to be)? We have a...
1
by: smauldin | last post by:
What is the overhead of using extended stored procedures? I created a table with 500,000 rows. 1) I ran a select on two columns and it runs in about 5 seconds. 2) I ran a select on one column...
3
by: bsandell | last post by:
We have an application that is based on several extended stored procedures. When we run our application in house, or when most other customers run it, they see performance of about X transactions...
5
by: Andrew Werden | last post by:
I've inherited some code that calls SYSIBM.SQLPROCEDURES to validate user provided parameters and text prior to executing a stored procedure. This code was written on an early UDB release (V6?)...
15
by: Együd Csaba | last post by:
Hi All, I've a problem with the perfprmance of the production environment. I've two db servers. One on my laptop computer (2Ghz, 1GB, WinXP, Cygwin, Postgres 7.3.4) and one on a production server...
4
by: Frank Villasenor | last post by:
Hello Everyone, Regarding stored procedures and views, I know that stored procedures cause SQL Server to create a cached execution plan. Is the same thing done for views? Also, how bad is the...
1
by: Demetri | last post by:
I have a question / concern regarding the new suggested way of creating a data access layer in an n-tier application. Typically, a web application specifically, using the SOA (Service Oriented...
7
by: Otto Carl Marte | last post by:
I have noticed an incredible difference in performance between DB2 LUW v8.2.5 and V9.1.1 with regards to CLOBs. I will sketch the scenario i have tested. I created a table with 1 Integer column,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.