Q
Problem solve Get help with specific problems with your technologies, process and projects.

Using rule-based optimization to optimize a query

A SearchOracle.com member asks, "Can I have a detailed explanation of how and when the 15 rules of Rule Based Optimization are used when optimizing a query?"

Can I have a detailed explanation of how and when the 15 rules of Rule Based Optimization are used when optimizing a query? I'm planning to make my own simple rule based query optimizer, any suggestions? Thanks.
The following document shows the rules used and a description of each rule:

http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96533/rbo.htm

What may not be obvious is that the RBO looks at rule #1. If that rule can be used, it uses that rule to execute the query and does not look any further. If Rule #1 fails, rule #2 is checked…and so on. The last rule is only used if all rules above it fail.

It shouldn't take too long to figure out why the RBO can sometimes make bad decisions. For instance, an index on the gender column (assuming even distribution) would take longer to satisfy the query than a full table scan. Yet such an index would always be used according to RBO. This is why the cost-based optimization (CBO) is preferred for today's Oracle implementations.

This was last published in January 2008

Dig Deeper on Oracle database administration

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close