Home » RDBMS Server » Performance Tuning » Bind variable issue (Oracle 9i)
Bind variable issue [message #583143] |
Fri, 26 April 2013 05:44  |
 |
savugar
Messages: 33 Registered: February 2012
|
Member |
|
|
Hi,
The below query is running slowly from today morning. When I check this query, I noticed that it is not using bind variables because both parse_calls and executions values are same. What change I have to do to utilize bind variable in this query?
SELECT * FROM ( SELECT a.id FROM XML_TAG T1 WHERE ( a.kln LIKE :P16 ) ) WHERE ROWNUM <= 200
SQL> select sql_text,users_executing,FETCHES,FIRST_LOAD_TIME,EXECUTIONS,PARSE_CALLS,ROWS_PROCESSED,HASH_VALUE,PLAN_HASH_VALUE,LAST_LOAD_TIME from v$sql where
hash_value=238154930;
SQL_TEXT USERS_EXECUTING FETCHES FIRST_LOAD_TIME EXECUTIONS PARSE_CALLS ROWS_PROCESSED HASH_VALUE PLAN_HASH_VALUE LAST_LOAD_TIME
------------------------------ --------------- ---------- ------------------- ---------- ----------- -------------- ---------- --------------- --------------
-----
SELECT * FROM ( SELECT 10 0 2013-04-12/07:28:54 10 10 0 238154930 2831607955 2013-04-26/11:22:16
a.id FROM XML_TAG A
WHERE ( a.kln LIKE
:P16 ) ) WHERE ROWNUM <= 200
SELECT * FROM ( SELECT 2 6 2013-04-12/07:28:54 8 8 32 238154930 2831607955 2013-04-26/11:09:54
a.id FROM XML_TAG A
WHERE ( a.kln LIKE
:P16 ) ) WHERE ROWNUM <= 200
[Updated on: Fri, 26 April 2013 05:49] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Bind variable issue [message #583157 is a reply to message #583154] |
Fri, 26 April 2013 06:15  |
John Watson
Messages: 8976 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Quote:But it is doing hard parse. That's why I am seeing the same value in both executions and parse_calls. No it is not doing a hard parse, it is doing a soft parse for each execution. If you want to reduce the soft parsing, set session_cached_cursors to a value greater than zero and then if a session soft parses the stament three times the cursoe will be cached in its PGA. Then you will see the figure for parse_calls stabilize. But each session has to do this.
|
|
|
Goto Forum:
Current Time: Sat May 03 20:16:50 CDT 2025
|