Re: Optimization question: Unrolling subquery into IN clause

From: Wolfram Roesler <>
Date: Mon, 19 Oct 2009 06:22:41 +0000 (UTC)
Message-ID: <>

madhu <> wrote in news:80c66c85-6c41-47c5-b9c2-

> Try adding a hint - /*+ index(tab1 index_name_on_col2) */, so Oracle
> chooses the index on col2.
> So the query would be:
> SELECT /*+ index(tab1 index_name_on_col2) */ several_columns
> ...

I tried that, and was astonished to find out that it made things even worse. The whole query takes 15 seconds with that hint. Oracle chooses to use that index automatically when the query is issued by the application using bind variables, which is why the application is even slower than the ad-hoc SQL query entered in sqlplus.

Thanks for your help
W. Rösler Received on Mon Oct 19 2009 - 01:22:41 CDT

Original text of this message