Want to post your scripts here in this blog ? Email it to snojha@gmail.com. You will be rewarded for your scripts if selected by our experts.

Monday, August 23, 2010

BIND VARIABLE PEEKING

There are 3 things that might put you at risk of unstable plans due to bind variable peeking.
1. Histograms: The histogram tells Oracle about data distribution
2. Partitions,
3. Range-based predicates

select column_name, endpoint_number, endpoint_value
from dba_tab_histograms
where table_name='TEST_INVOICE';

Just get rid of any histogram that does nothing but messes up your execution plans.


exec dbms_stats.gather_table_stats('table_owner', 'test_invoice', method_opt => 'for columns invoice_id size 1', cascade => true);

No comments: