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!

How to check if a hint was used

1055717Jul 3 2014 — edited Jul 3 2014

Hi All

Is there a way to determine if a hint was used in a SQL statement?

Example
I got a call from a developer saying that their query was going very slow

I checked what oracle was doing

It was using an index with 5 distinct values on a table with a row count of 9.2 million

Selectivity was very bad.

I then discovered after talking to the developer that he had a hint in to use the index (idiot)

Once we took the hint out it did a Full Table scan and actually ran a lot faster.

However when I was looking at the SQL text in v$sql and v$sqlarea there was no way to tell if a Hint was being used

IE I did see: /* + RULE */ in the code.

Does anyone know how to check (from the DB) if a hint is being used in a sql statement?

And if the hint is being used, what the hint is.

Thanks

G.

This post has been answered by Jagdeep Sangwan on Jul 3 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 31 2014
Added on Jul 3 2014
4 comments
2,347 views