Bind Variable Peeking, Histograms and Invalidating of a cursor in shared pool
Hi,
In a 10g database (10.2.0.4), assuming that bind variable peeking is in place (the default) and due to the nature of it, sometimes
it generates and start using a really bad execution plan based on the passed on value (of bind variable)
Let us suppose that there is a query involving 3 tables. One of the columns in one of the table has SKEWED data as below
select flag,count(*) from table_a group by flag;
FLAG Count(*)
================
Y 955489
N 12
In the query, there is a where clause like this --> where table_a.flag=:1 (yep, the query is using bind variable)
In a 10g database (10.2.0.4), assuming that bind variable peeking is in place (the default) and due to the nature of it, sometimes
it generates and start using a really bad execution plan based on the passed on value (of bind variable)
Let us suppose that there is a query involving 3 tables. One of the columns in one of the table has SKEWED data as below
select flag,count(*) from table_a group by flag;
FLAG Count(*)
================
Y 955489
N 12
In the query, there is a where clause like this --> where table_a.flag=:1 (yep, the query is using bind variable)
0