# Bind variable peeking doesn't work

**URL:** <https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [June 3, 2015, 12:19am UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411 "2015-06-03T00:19:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergey1231](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sergey1231](https://forums.toadworld.com/u/sergey1231)\
**Post date:** [June 3, 2015, 12:19am UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/1 "2015-06-03T00:19:43Z")

</div>

Hello.  
I’m trying to test Oracle Adaptive Cursor Sharing on Oracle 11.2.0.4 using this article

> **[On Tuning by Tracing](https://blogs.oracle.com/oraclemagazine/on-tuning-by-tracing)**
>
> Our technologist does a tune-up with SQL\_TRACE.

  
But something goes wrong. When I execute in TOAD  
select \* from t where id = :id;  
IS\_BIND\_SENSITIVE field in V$SQL is always ‘N’. When execute the same sql in SqlPlus IS\_BIND\_SENSITIVE is ‘Y’.  
I think that is because TOAD is using OCI version 7 that doesn’t support Bind variable peeking.  
How to check what version of OCI is used by TOAD?  
With best regards Sergey.

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [June 3, 2015, 5:42am UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/2 "2015-06-03T05:42:42Z")

</div>

Toad’s login window has a dropdown labeled “Connect Using”. This is used to select which Oracle home you want to use. Click the ellipsis (…) button next to it for details about all of your Oracle homes. The version number is listed in parenthesis right after the Oracle Home Name, with details of each Oracle Home under that. I would be really surprised if you are using an Oracle 7 client. It was about 20 years ago when Oracle 7 was released.

---

<div class="post-metadata">

**Author:** ![sergey1231](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sergey1231](https://forums.toadworld.com/u/sergey1231)\
**Post date:** [June 3, 2015, 6:02am UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/3 "2015-06-03T06:02:05Z")

</div>

Thanks fo reply. My version is 11.2.0.1. As I understand it is a version of the client.

The oracle client contains OCI methods of previous versions for backward compatibility, choice of functions depends on the application. Which version of OCI is used by Toad?

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [June 3, 2015, 6:05am UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/4 "2015-06-03T06:05:33Z")

</div>

We do not use the old OCI 7 calls.

---

<div class="post-metadata">

**Author:** ![sergey1231](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sergey1231](https://forums.toadworld.com/u/sergey1231)\
**Post date:** [June 3, 2015, 6:12am UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/5 "2015-06-03T06:12:48Z")

</div>

Could you explain why IS\_BIND\_SENSITIVE is always ‘N’, when I execute SQL in TOAD?

---

<div class="post-metadata">

**Author:** ![mstaszew](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/mstaszew/32/23_2.png) [@mstaszew](https://forums.toadworld.com/u/mstaszew)\
**Post date:** [June 3, 2015, 6:24am UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/6 "2015-06-03T06:24:01Z")

</div>

I didn’t read the entire article or anything on the Adaptive Cursor Sharing so this might not make any sense, but…

Are your tests dependent on executing in the same session? If so, be sure that you have the “Execute Scripts in Toad Session” option checked in Options on the  
Oracle, Transactions page if you’re executing as script (F5, lightning bolt button). If you’re executing using F9 or the green triangle button then make sure you’re executing all statements within the same editor tab or disable the “Execute queries in threads”  
checkbox in Options on the Oracle, Transactions page.

Those options can spawn new sessions so any session specific work being done won’t necessarily carry over to your next execution. Disabling them might help you  
track down the difference.

Michael

**From:** sergey1231 [[mailto:bounce-sergey1231@toadworld.com](mailto:bounce-sergey1231@toadworld.com)]

**Sent:** Wednesday, June 03, 2015 9:13 AM

**To:** [toadoracle@toadworld.com](mailto:toadoracle@toadworld.com)

**Subject:** RE: [Toad for Oracle - Discussion Forum] Bind variable peeking doesn’t work

[**RE: Bind variable peeking doesn’t work**](http://www.toadworld.com/products/toad-for-oracle/f/10/p/24653/54324.aspx#54324)

Reply by sergey1231

Can you explain why IS\_BIND\_SENSITIVE is always ‘N’, when I execute SQL in TOAD?

To reply, please reply-all to this email.

[Stop receiving emails](http://www.toadworld.com/products/toad-for-oracle/f/10/t/24653.aspx?subscribe=false)  
on this subject.

Or [Unsubscribe from Toad for Oracle - General](http://www.toadworld.com/products/toad-for-oracle/f/10.aspx?subscribe=false)  
notifications altogether.

Toad for Oracle - Discussion Forum

[Flag](http://www.toadworld.com/products/toad-for-oracle/f/10/p/24653/54324.aspx?AbuseContentId=4b601b93-f437-4dd2-871d-f2bf6ebc9816&AbuseContentTypeId=f586769b-0822-468a-b7f3-a94d480ed9b0&AbuseFlag=true)  
this post as spam/abuse.

![http://04j0.mj.am/o/04j0/2ab8ed48/i9y2mspe.gif](http://04j0.mj.am/o/04j0/2ab8ed48/i9y2mspe.gif)

---

<div class="post-metadata">

**Author:** ![sergey1231](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sergey1231](https://forums.toadworld.com/u/sergey1231)\
**Post date:** [June 3, 2015, 6:52am UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/7 "2015-06-03T06:52:21Z")

</div>

I execute only one SQL in session:

select \* from t where id = :id

I press F9 and set id = 1, type NUMBER on popup Variables window.

I execute script:

"var id NUMBER;

exec :id := 1;

select \* from t where id = :id;"

by pressing F5, with and without “Execute Scripts in Toad Session” option.

Result is same IS\_BIND\_SENSITIVE is always ‘N’.

---

<div class="post-metadata">

**Author:** ![mstaszew](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/mstaszew/32/23_2.png) [@mstaszew](https://forums.toadworld.com/u/mstaszew)\
**Post date:** [June 3, 2015, 7:03am UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/8 "2015-06-03T07:03:10Z")

</div>

Edit: You didn’t mention whether or not you had execute queries in threads checked. If that’s checked then your F9 and F5 are running in different sessions.

The process you describe results \*\*might result \*\*in your F9 statement and F5 script executing in different sessions. That might be OK, but if it needs to be in the same session for your tests then do exactly as you just described, but make sure that “execute queries in threads” is unchecked and that “executed scripts in Toad session” is checked. I’d close your session after changing those options and try again.

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [June 3, 2015, 7:14am UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/9 "2015-06-03T07:14:21Z")

</div>

I’ve been playing with it this morning - I have execute queries in threads turned off and I can reproduce the IS\_BIND\_SENSITIVE always being ‘N’. I don’t know why this is so.

---

<div class="post-metadata">

**Author:** ![mstaszew](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/mstaszew/32/23_2.png) [@mstaszew](https://forums.toadworld.com/u/mstaszew)\
**Post date:** [June 3, 2015, 7:33am UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/10 "2015-06-03T07:33:03Z")

</div>

The process you describe results in your F9 statement and F5 script executing in different sessions. That might be OK, but if it needs to be in the same session  
for your tests then do exactly as you just described, but make sure that “execute queries in threads” is unchecked and that “executed scripts in Toad session” is checked. I’d close your session after changing those options and try again.

**From:** sergey1231 [[mailto:bounce-sergey1231@toadworld.com](mailto:bounce-sergey1231@toadworld.com)]

**Sent:** Wednesday, June 03, 2015 9:53 AM

**To:** [toadoracle@toadworld.com](mailto:toadoracle@toadworld.com)

**Subject:** RE: [Toad for Oracle - Discussion Forum] Bind variable peeking doesn’t work

**[RE: Bind variable peeking doesn’t work](http://www.toadworld.com/products/toad-for-oracle/f/10/p/24653/54326.aspx#54326)**

Reply by sergey1231

I execute only one SQL in session:

select \* from t where id = :id

I press F9 and set id = 1, type NUMBER on popup Variables window.

I execute script:

"var id NUMBER;

exec :id := 1;

select \* from t where id = :id;"

by pressing F5, with and without “Execute Scripts in Toad Session” option.

Result is same IS\_BIND\_SENSITIVE is always ‘N’.

To reply, please reply-all to this email.

[Stop receiving emails](http://www.toadworld.com/products/toad-for-oracle/f/10/t/24653.aspx?subscribe=false) on this subject.

Or [  
Unsubscribe from Toad for Oracle - General](http://www.toadworld.com/products/toad-for-oracle/f/10.aspx?subscribe=false) notifications altogether.

Toad for Oracle - Discussion Forum

[Flag](http://www.toadworld.com/products/toad-for-oracle/f/10/p/24653/54326.aspx?AbuseContentId=de0a0e73-b191-495a-837e-dff1fc66e176&AbuseContentTypeId=f586769b-0822-468a-b7f3-a94d480ed9b0&AbuseFlag=true)  
this post as spam/abuse.

![](http://04j0.mj.am/o/04j0/bb95fe90/i99wh9qe.gif)

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [June 3, 2015, 9:54am UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/11 "2015-06-03T09:54:23Z")

</div>

I’m still not exactly sure what the technical reason for this not working is, but there are a couple of different ways that we can run SELECT statements internally. The way it’s done in the editor causes IS\_BIND\_SENSITIVE to always be false. Most of the other places in Toad use a method where it does not cause that. So I think we can safely change it once we get into betas for Toad 12.8 (or whatever we end up calling the next version…I’m not sure if any decision has been made to avoid the number 13 or not! haha)

---

<div class="post-metadata">

**Author:** ![sergey1231](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sergey1231](https://forums.toadworld.com/u/sergey1231)\
**Post date:** [June 3, 2015, 8:21pm UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/12 "2015-06-03T20:21:15Z")

</div>

Thanks John, I will wait for a new version of TOAD.

---

<div class="post-metadata">

**Author:** ![dinch.osman](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/dinch.osman/32/16327_2.png) [@dinch.osman](https://forums.toadworld.com/u/dinch.osman)\
**Post date:** [December 2, 2023, 4:46pm UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/13 "2023-12-02T16:46:18Z")

</div>

Bind variable peeking and ACS(Adaptive cursor sharing) still not working in TOAD 16.1.53. Did you investigate the issue?

If you are executing queries with DBMS\_SQL package. It may be related with Bug 13386678.

In short, DBMS\_SQL uses the old RPI interface, which doesn't support bind peeking.

---

<div class="post-metadata">

**Author:** ![dinch.osman](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/dinch.osman/32/16327_2.png) [@dinch.osman](https://forums.toadworld.com/u/dinch.osman)\
**Post date:** [December 3, 2023, 9:38pm UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/14 "2023-12-03T21:38:08Z")

</div>

Although not sure, Looks like related with the parse is done without binds.  
"[SQL with bind vars is very slow in toad - #26 by NormTeamT](https://forums.toadworld.com/t/sql-with-bind-vars-is-very-slow-in-toad/49455/26)"

When i investigate the issue with 10053, i can see that parse is done with "No bind buffers allocated".

Regards,  
Osman DİNÇ

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [December 4, 2023, 1:27pm UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/15 "2023-12-04T13:27:19Z")

</div>

Osman, the problem brought up in this post was solved several years ago.

You said _"Bind variable peeking and ACS(Adaptive cursor sharing) still not working in TOAD 16.1.53"_

Can you give me some clear steps to reproduce the problem? Just saying that something "doesn't work" is not clear.

Thank you.

---

<div class="post-metadata">

**Author:** ![dinch.osman](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/dinch.osman/32/16327_2.png) [@dinch.osman](https://forums.toadworld.com/u/dinch.osman)\
**Post date:** [December 4, 2023, 3:22pm UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/16 "2023-12-04T15:22:33Z")

</div>

> [@dinch.osman](#):
>
> 13386678

Hi John,

Here is the test case.

--Checking ACS related parameters (It is all default values)  
SELECT a.KSPPINM "PARAMETER",  
b.KSPPSTDF "IS\_DEFAULT",  
b.KSPPSTVL "SESSION",  
c.KSPPSTVL "INSTANCE"  
FROM X$KSPPI a, X$KSPPCV b, X$KSPPSV c  
WHERE a.INDX = b.INDX  
AND a.INDX = c.INDX  
AND a.KSPPINM IN ('\_optim\_peek\_user\_binds',  
'\_optimizer\_adaptive\_cursor\_sharing',  
'\_optimizer\_extended\_cursor\_sharing',  
'\_optimizer\_extended\_cursor\_sharing\_rel');

PARAMETER IS\_DEFAULT SESSION INSTANCE  
\_optimizer\_extended\_cursor\_sharing TRUE UDO UDO  
\_optimizer\_extended\_cursor\_sharing\_rel TRUE SIMPLE SIMPLE  
\_optimizer\_adaptive\_cursor\_sharing TRUE TRUE TRUE  
\_optim\_peek\_user\_binds TRUE TRUE TRUE

create table system.test (pk int, data char(100));

-- 500k rows, almost all of them pk=20

INSERT INTO system.test  
SELECT CASE WHEN ROWNUM \< 20 THEN ROWNUM ELSE 20 END, ROWNUM  
FROM DUAL connect by level\<= 500000

commit;

create index index on test(pk);

exec dbms\_stats.gather\_table\_stats ('SYSTEM','test');

-- create histogram  
exec dbms\_stats.gather\_table\_stats ('SYSTEM','test', method\_opt=\>'for columns pk size 200');

-- Now run all commands in SQLPLUS  
-- bind input 10 , we expect an index scan  
var vr1 number;  
exec :vr1:=10;

select max(data) max\_data, count(_) from system.test where pk =:vr1;  
MAX\_DATA COUNT(_)  
10 1

select \* from dbms\_xplan.display\_cursor(format=\>'+peeked\_binds');

## PLAN\_TABLE\_OUTPUT

## SQL\_ID 4csc6dsrzjnc8, child number 0

select max(data) max\_data, count(\*) from system.test where pk =:vr1

Plan hash value: 2838211638

* * *

## | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |

## | 0 | SELECT STATEMENT | | | | 4 (100)| | | 1 | SORT AGGREGATE | | 1 | 104 | | | | 2 | TABLE ACCESS BY INDEX ROWID BATCHED| TEST | 1 | 104 | 4 (0)| 00:00:01 | |\* 3 | INDEX RANGE SCAN | INDEX1 | 1 | | 3 (0)| 00:00:01 |

## Peeked Binds (identified by position):

1 - :VR1 (NUMBER): 10

Predicate Information (identified by operation id):

## PLAN\_TABLE\_OUTPUT

3 - access("PK"=:VR1)

--sql\_id is 4csc6dsrzjnc8. -- sql is marked as bind\_sensitive  
select sql\_id,sql\_text,child\_number,is\_shareable,is\_bind\_sensitive,is\_bind\_aware from v$sql where sql\_id='4csc6dsrzjnc8';  
SQL\_ID SQL\_TEXT CHILD\_NUMBER IS\_SHAREABLE IS\_BIND\_SENSITIVE IS\_BIND\_AWARE  
4csc6dsrzjnc8 select max(data) max\_data, count(\*) from test where pk =:vr1 0 Y Y N

-- bind input 20 this time , we expect an index scan in first execute, as rows returned will fluctuate too much, it will switch to fulltable scan on second execution  
var vr1 number;  
exec :vr1:=20;  
select max(data) max\_data, count(_) from system.test where pk =:vr1;  
select max(data) max\_data, count(_) from system.test where pk =:vr1;

MAX\_DATA COUNT(\*)

* * *

99999 499981

select \* from dbms\_xplan.display\_cursor(format=\>'+peeked\_binds');

## PLAN\_TABLE\_OUTPUT

## SQL\_ID 4csc6dsrzjnc8, child number 1

select max(data) max\_data, count(\*) from system.test where pk =:vr1

Plan hash value: 1950795681

* * *

## | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |

## | 0 | SELECT STATEMENT | | | | 2060 (100)| | | 1 | SORT AGGREGATE | | 1 | 104 | | | |\* 2 | TABLE ACCESS FULL| TEST | 499K| 49M| 2060 (1)| 00:00:01 |

## Peeked Binds (identified by position):

1 - :VR1 (NUMBER): 20

## Predicate Information (identified by operation id):

## PLAN\_TABLE\_OUTPUT

2 - filter("PK"=:VR1)

select sql\_id,sql\_text,child\_number,is\_shareable,is\_bind\_sensitive,is\_bind\_aware from v$sql where sql\_id='4csc6dsrzjnc8';

SQL\_ID SQL\_TEXT CHILD\_NUMBER IS\_SHAREABLE IS\_BIND\_SENSITIVE IS\_BIND\_AWARE  
4csc6dsrzjnc8 select max(data) max\_data, count(_) from test where pk =:vr1 0 N Y N  
4csc6dsrzjnc8 select max(data) max\_data, count(_) from test where pk =:vr1 0 Y Y Y

--flush shared pool  
alter system flush shared\_pool;

**--- Now run all commands in TOAD session**  
-- for binds enter input (10 first, then 20)  
-- You wont get a new child cursor, you will always see an index scan and your sql will not be marked as bind\_sensitive.  
-- enter 10  
select max(data) max\_data, count(_) from system.test where pk =:vr1;  
MAX\_DATA COUNT(_)  
10 1

select \* from dbms\_xplan.display\_cursor(format=\>'+peeked\_binds');

## SQL\_ID 4csc6dsrzjnc8, child number 0

select max(data) max\_data, count(\*) from system.test where pk =:vr1

Plan hash value: 2838211638

* * *

## | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |

## | 0 | SELECT STATEMENT | | | | 430 (100)| | | 1 | SORT AGGREGATE | | 1 | 104 | | | | 2 | TABLE ACCESS BY INDEX ROWID BATCHED| TEST | 25000 | 2539K| 430 (0)| 00:00:01 | |\* 3 | INDEX RANGE SCAN | INDEX1 | 25000 | | 51 (0)| 00:00:01 |

## Predicate Information (identified by operation id):

3 - access("PK"=TO\_NUMBER(:VR1))

--sql\_id is 4csc6dsrzjnc8. -- sql is not marked as bind\_sensitive  
select sql\_id,sql\_text,child\_number,is\_shareable,is\_bind\_sensitive,is\_bind\_aware from v$sql where sql\_id='4csc6dsrzjnc8';  
SQL\_ID SQL\_TEXT CHILD\_NUMBER IS\_SHAREABLE IS\_BIND\_SENSITIVE IS\_BIND\_AWARE  
4csc6dsrzjnc8 select max(data) max\_data, count(\*) from test where pk =:vr1 0 Y N N

--enter 20  
select max(data) max\_data, count(_) from system.test where pk =:vr1;  
MAX\_DATA COUNT(_)  
20 499981

select \* from dbms\_xplan.display\_cursor(format=\>'+peeked\_binds');

## SQL\_ID 4csc6dsrzjnc8, child number 0

select max(data) max\_data, count(\*) from system.test where pk =:vr1

Plan hash value: 2838211638

* * *

## | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |

## | 0 | SELECT STATEMENT | | | | 430 (100)| | | 1 | SORT AGGREGATE | | 1 | 104 | | | | 2 | TABLE ACCESS BY INDEX ROWID BATCHED| TEST | 25000 | 2539K| 430 (0)| 00:00:01 | |\* 3 | INDEX RANGE SCAN | INDEX1 | 25000 | | 51 (0)| 00:00:01 |

## Predicate Information (identified by operation id):

3 - access("PK"=TO\_NUMBER(:VR1))

--sql\_id is 4csc6dsrzjnc8. -- sql is not marked as bind\_sensitive  
select sql\_id,sql\_text,child\_number,is\_shareable,is\_bind\_sensitive,is\_bind\_aware from v$sql where sql\_id='4csc6dsrzjnc8';  
SQL\_ID SQL\_TEXT CHILD\_NUMBER IS\_SHAREABLE IS\_BIND\_SENSITIVE IS\_BIND\_AWARE  
4csc6dsrzjnc8 select max(data) max\_data, count(\*) from test where pk =:vr1 0 Y N N

I think, In TOAD you are parsing sql statement with a DBMS\_SQL command before execution.

And according to the Doc ID 2977764.1, "As far as why bind peeking doesn't happen, this is because DBMS\_SQL doesn't support it. See this in the known issue Bug 13386678.  
In short, DBMS\_SQL uses the old RPI interface, which doesn't support bind peeking."

As bind peeking is not fired in TOAD, CBO(Cost based optimizer) makes estimation of returned rows will be 25000, as you may see in the plan.(Total rows(500.000) x 0,05) This is a hardcoded value according to the Doc ID 70075.1 Use of Bind Variables in Queries (Pre-9i).

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [December 4, 2023, 3:52pm UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/17 "2023-12-04T15:52:42Z")

</div>

Hi Osman,

Toad does not use DBMS\_SQL to parse the SQL. We do, however, use an OCI "Describe" command ([as documented here](https://docs.oracle.com/en/database/oracle/oracle-database/19/lnoci/using-sql_statements-in-oci.html#GUID-1FE451DB-FB37-4966-8334-AE04E532D27C)) before query execution to learn the datatypes, but I don't know what Oracle does with that behind the scenes (I doubt it's dbms\_sql, but that's up to the Oracle server, not Toad). We perform this "Describe" command in order to determine an ideal number of rows per fetch, and to check for XMLTYPE and CLOB columns. If these are present, we have to get some info about the table incase you later want to edit these columns.

I'm sorry, there is no way to disable the OCI Describe call that Toad makes.

-John

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [December 4, 2023, 8:25pm UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/18 "2023-12-04T20:25:16Z")

</div>

I've been playing with the example in the original post, running a SQL like this:

select \* from t where id = :id;

and then looking at IS\_BIND\_SENSITIVE field in V$SQL. I see 'N' when using Toad with an Oracle client, and 'Y' when using Toad without an Oracle client. This could explain some questions I've had recently about why Toad sometimes runs things faster/slower depending on if an Oracle client is used (or compared to other products).

It does seem to be related to the OCI describe, which you can't turn off right now in Toad, but I can make a change so that we don't do the describe if change this option to "manual".

 ![image](https://global.discourse-cdn.com/quest/original/3X/c/2/c2b6f33adcad61688e23cf3b9bc2e0fd601efc3f.png)

I'll have that in next beta (which will be available 11-Dec-2023).

---

<div class="post-metadata">

**Author:** ![dinch.osman](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/dinch.osman/32/16327_2.png) [@dinch.osman](https://forums.toadworld.com/u/dinch.osman)\
**Post date:** [December 5, 2023, 7:41am UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/19 "2023-12-05T07:41:49Z")

</div>

Hey John, That is awesome news for performance tuning experts .

I have also tested this behavior with other products like DBeaver and SQLDeveloper. SQLDeveloper was the only product for running sql statements as bind aware. With the next beta release, TOAD will also have the capability to work as bind aware.

I also found this blog post may be related with the issue by Patrick Jolliffe. [Bind Variable Peeking Problems via OCI | jolliffe.hk](https://jolliffehk.wordpress.com/2016/05/05/bind-variable-peeking-problems-via-oci/)

I will write a blog post about ACS(Adaptive Cursor Sharing) and also share this good news with the community.  
Thank you for your prompt action. It’s greatly appreciated.

Regards  
Osman DİNÇ

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [December 5, 2023, 7:45pm UTC](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411/20 "2023-12-05T19:45:38Z")

</div>

Setting `"_fix_control"='9630092:ON'` as described in metalink [Doc ID 9630092.8](https://support.oracle.com/epmos/faces/DocumentDisplay?id=9630092.8&displayIndex=2) and in the article that you reference doesn't seem to solve the problem. ☹

[Next page](https://forums.toadworld.com/t/bind-variable-peeking-doesnt-work/33411.md?page=2)
