Question

Is there any hints in Oracle that works the same way as these SQL Server hints?

Recompile: That a query is recompiled every time it's run (if execution plans should vary greatly depending on parameters). Would this be best compared to cursor_sharing in Oracle?

Optimize for: When you want the plan to get optimized for a certain parameter even if a different one is used the first time the SQL is run? I guess maybe could be helped with cursor_sharing as well?

Was it helpful?

Solution

Since you're using 11g, Oracle should use adaptive cursor sharing by default. If you have a query that uses bind variables and the histogram on the column with skewed data indicates that different bind variable values should use different query plans, Oracle will maintain multiple query plans for the same SQL statement automatically. There would be no need to specifically hint the queries to get this behavior, it's already baked in to the optimizer.

OTHER TIPS

I didn't know, but found a discussion with some solutions here on forums.oracle.com

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top