Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Negative impact of SESSION_CACHED_CURSORS parameter
Hi List,
In our DB we see huge number of softparses during the load test. So I thought of setting SESSION_CACHED_CURSORS parameter to positive number(100) to take advantage of SOFTER SOFT PARSE. But I am getting negative impact. Kindly advice me what is going on here.
Version :8.1.7.3
OS: Sun Solaris
tkprof output
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 165 (recursive depth: 1)
Rows Row Source Operation
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 165 (recursive depth: 1)
Rows Row Source Operation
Program used to generate the above trace file.
alter session set SQL_TRACE=true;
alter session set session_cached_cursors=0;
declare
type rc is ref cursor;
C rc;
n number :=0;
begin
n := dbms_utility.get_time;
for i in 1 .. 2000 loop
open C for select /*+ cached cursors 0 */ first_name,last_name,customerid,countryabbrev from t1 p,t2 e,t3 c where p.t1id=e.t1id and p.business_country_id=c.countryabbrev;
close C;
end loop;
dbms_output.put_line( dbms_utility.get_time - n );
end;
/
alter session set session_cached_cursors=100;
declare
type rc is ref cursor;
C rc;
n number :=0;
begin
n := dbms_utility.get_time;
for i in 1 .. 2000 loop
--open C for select /*+ cached_cursors 100 */ * from dual; open C for select /*+ cached cursors 100 */first_name,last_name,customerid,countryabbrev from t1 p,t2 e,t3 c where p.t1id=e.t1id and p.business_country_id=c.countryabbrev;
close C;
end loop;
dbms_output.put_line( dbms_utility.get_time - n );
end;
/
SQL> @x
Session altered.
Session altered.
394
PL/SQL procedure successfully completed.
Session altered.
413
PL/SQL procedure successfully completed.
SQL>
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: INET: jaysingh1_at_optonline.net Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting servicesReceived on Fri Nov 28 2003 - 09:44:32 CST
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).