Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

is_bind_sensitive, is_bind_aware, execution in view

Jorge1-JavaNetApr 10 2020 — edited Apr 11 2020

Hi there,
I have a query that the where uses a field that has a bind and executes on a view with a join between two tables. I have generated histograms on that column in the following way:
       dbms_stats.gather_table_stats
                   ('owner'
                   , 'table'
                   , method_opt => 'FOR ALL COLUMNS SIZE 1 FOR COLUMNS SIZE 2024 NUMBER'
                   , estimate_percent => 100
                   , cascade => true
                   , no_invalidate => false
                   );
END;
/
The column data is not uniform, I have values that clearly use full and other indexes, but the optimizer always shows me the full, hurting performance (even if I am looking for a single value). I have seen that it never marks me in the fields of the V $ sql is_bind_sensitive, and therefore it never marks is_bind_aware and it doesn't take advantage of the cursor (it always has the same plan). I have done tests with a normal table with little uniform data and with the same statistics, and it works perfectly. My question is the following: is it possible that I do not use cursor sharing due to the use of views?
Thanks a lot

Comments
Post Details
Added on Apr 10 2020
2 comments
997 views