Skip to Main Content

Oracle Database Discussions

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!

Hint PRECOMPUTE_SUBQUERY

sql_coderNov 3 2014 — edited Nov 3 2014

Hello,

Oracle DBMS: 12.1.0.1.5

I have a table with about 35 million records. One query has five limitations in the WHERE clause. Three of them are comparing them with bind variables and the other two have an IN operator with a subquery (that subquery uses bind variables, but it is not corrolated). An index over all 5 columns exist. What the optimizer is doing, he is using the index with the 3 conditions without the subquery and after that filter the records with the other 2 conditions from the subquery .But it is very importend for the performance of the query, that the two subqueries will be executed before he is using that index. So I found the undocumented hint PRECOMPUTE_SUBQUERY. And in 12c it is working with that hint. My question is, I dont think the hint works in 11g. But I am not sure about it, cause it is not documented. Can anyone confirm that the hint is working only since 12c and is there any hint for 11g, so the subqueries will be executed first ?

sql_coder

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 1 2014
Added on Nov 3 2014
7 comments
2,320 views