Database Tuning (MOSC)

MOSC Banner

Optimizer gives wrong estimates on outer join (11.2 with fresh statistics)

edited Sep 8, 2011 9:09AM in Database Tuning (MOSC) 7 commentsAnswered ✓
Hello

I am having a problem with a query that is used in a frequently used view. The query runs fine, but the optimizer consistently estimates wrong about the result of an outer join with a where statement with or in it. The problem with the wrong estimates are that querys ased on the view often choose the wrong execution plan because of these wrong estimates. I can rewrite the query, so that the problem goes away, but the rewritten query will often perform worse than the original one.

I would like some input as how to get the estimates right. A well-performing rewritten query is just fine. Alter session set some-optimizer-feature=on/off is fine as well. Adding extra statistics, such as 11.2 extended stats if fine as well, since it will run on 11.2. Changing the datamodel is a no-go, though.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center