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

# Difference between RBO and CBO

## I do not have a clear idea about SQL tuning (Rule Based vs. Cost Based Optimizer). Could you explain the difference between RBO and CBO?

I do not have a clear idea about SQL tuning (Rule Based vs. Cost Based Optimizer). Could you explain the difference between RBO and CBO?

SQL statement tuning and the differences between RBO and CBO is quite a topic. Hopefully, the following will get you started. But more study will be necessary as this is only a cursory glance at the subject.

Whenever Oracle receives a SQL statement, it must decide the best manner in which to retrieve the data from the database. It is the job of the Optimizer to determine the most efficient method to use. There could be many different access paths to the data. In the earliest versions of Oracle, the Optimizer used a set of rules (RBO) to decide how to execute a given SQL statement. One rule stated than an index would be used in favor of a full table scan. So let's look at an example table of employees:

```EMP
--------------------
ID     NUMBER  PRIMARY KEY
NAME   VARCHAR2(30)
GENDER CHAR(1)
```
On the EMP table, I have an index on the ID column and an index on the GENDER column. Since the ID is unique, querying for a specific ID can be most often facilitated by using the index. The Rule Based Optimizer (RBO) would always use this index to perform the query. Now let's query the same table for all females (GENDER='F'). The RBO, using the same rule, would use the index on this column to execute the query. Assuming equal distribution, the same number of men and women in the company, an index would be less effecient than simply scanning the entire table. Let's further assume that this table only has five rows of data that all fit comfortably in one database block, which requires only one I/O operation to read. Reading an index block, even for the ID column, would be more inefficient than performing a full table scan. SQL statement tuning when using RBO came down to the DBA obtaining an understanding of the data distribution and determining the best access path not found according to the RBO. The DBA would then rewrite the SQL statement to use the rule the DBA determined was most efficient.

The RBO has its share of problems as the above examples show. The RBO did not take into account data distribution or the size of the table. The Cost Based Optimizer (CBO) uses this type of information to make better informed decisions. The CBO needs statistics to be able to make informed decisions on the quickest access paths. SQL statement tuning under the CBO involves making sure that the correct statistics are in place, and even locking down statistics so that changes to the data do not affect the SQL statement processing. Additionally, the DBA can make use of Stored Outlines so as to get the same consistent access path for the queries. The DBA can still use SQL hints to influence the CBO as well, similar to the RBO.

## SearchDataManagement

• ### Era Software raises \$15.25M for enterprise data management

Startup that began as the EraDB time series database is advancing its efforts with new funding and a cloud service for its ...

• ### Dgraph GraphQL database users detail graph use cases

Graph DB vendor Dgraph Labs is expanding its AWS cloud footprint with new regions and adding change data capture capabilities in ...

• ### Pandemic triggered data security movement to DBaaS

Database-as-a-service technology has aided enterprises tasked with keeping data secure with IT professionals working from home ...

• ### Startup Veezoo emerges from stealth with NLQ-based platform

Aiming to be 'Siri for enterprises,' an analytics startup emerged from stealth with a platform that enables users to interact ...

• ### 15 data science tools to consider using in 2021

Numerous tools are available for data science applications. Read about 15, including their features, capabilities and uses, to ...

• ### Insightsoftware acquisition of Izenda targets embedded BI

ERP vendor Insightsoftware acquired embedded analytics specialist Izenda on April 15, marking its second purchase of an embedded ...

## SearchSAP

• ### S/4HANA Cloud SaaS ERP: Buying team overview

SAP's multi-tenant SaaS ERP, S/4HANA Cloud, is a viable choice for companies that need ease in their infrastructure management. ...

• ### SAP forms financial services partnership with Dediq

SAP and financial industry investment firm Dediq are forming a new business unit to develop applications that help banks and ...

• ### Unpatched applications threaten SAP security

Cyberattacks are a significant threat to unpatched, unprotected SAP applications, according to a new threat intelligence report ...

## SearchSQLServer

• ### SQL Server database design best practices and tips for DBAs

Good database design is a must to meet processing needs in SQL Server systems. In a webinar, consultant Koen Verbeeck offered ...

• ### SQL Server in Azure database choices and what they offer users

SQL Server databases can be moved to the Azure cloud in several different ways. Here's what you'll get from each of the options ...

• ### Using a LEFT OUTER JOIN vs. RIGHT OUTER JOIN in SQL

In this book excerpt, you'll learn LEFT OUTER JOIN vs. RIGHT OUTER JOIN techniques and find various examples for creating SQL ...

## TheServerSide.com

• ### Incorporate diversity and inclusion in technology design

DEI in technology is about more than creating a diverse workplace. We talked to a few DEI professionals about how teams build ...

• ### Microsoft previews OpenJDK distro to the delight of devs

In a move meant to attract more Java developers to its Azure cloud and further support the Java community, Microsoft launched a ...

• ### Supreme Court ruling on Java APIs eases developer worries

Now that the Supreme Court has ruled for Google over Oracle in their high-stakes copyright battle over Java APIs, developers can ...

## SearchDataCenter

• ### Nvidia SDK simulates quantum computing circuits on GPU systems

Nvidia edged its way into the quantum computing market with an SDK that simulates quantum circuits by adding horsepower to ...

• ### Programmable processor technology for next-gen data centers

The right processing technology can benefit your data center. Learn about advancements in CPU technologies, recent vendor ...

• ### Data processing units accelerate infrastructure performance

DPUs often run on networking packets to move information in the data center, instead of supporting processing workflows. Get an ...

## SearchContentManagement

• ### OpenText releases Cloud Editions content services updates

OpenText CE 21.2 includes federated document compliance that extends to Microsoft Office 365, along with a revamped content ...

As the pandemic disrupts paper workflows, Adobe courts small business users with simple webforms, digital signatures and payments...

• ### Know when to use a headless CMS and when it's not worth it

Headless CMSes aren't a silver bullet for every circumstance. Evaluate three solid use cases for a headless CMS and three ...

## SearchHRSoftware

• ### Face mask detection a newcomer to employee surveillance

Face mask detection has emerged as another form of employee surveillance technology, and its adoption may be helped indirectly by...

• ### 20 diversity and inclusion tools to power your DEI program

Diversity and inclusion tools shouldn't replace strategy, but these tools can help companies in multiple ways, from tracking ...

• ### DEI tools arrive at critical time for HR

Employers are being held accountable for meeting diversity, equity and inclusion goals, especially executives. HR vendors are ...

Close