Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 4

SQL Tuning

Non Scalable
Response Time

Scalable

Number of Users

The goal of SQL Tuning is to make your database queries scalable.


Cost Based Optimizer (CBO)
• Cost Components:
– I/O Cost
– CPU Cost
– Network Cost

• The Cost Based Optimizer (CBO) is a component of the


data server responsible for generating the most optimal
execution plan for SQL statements.
• Cost is a relative index as to the amount of resources
needed to execute a particular SQL statement.
• The CBO attempts to choose the plan with the least cost
with the assumption that a lower cost plan performs
better than a higher cost plan.
SQL Processing
Return results

Select ol.LINE_ID,
oh.HEADER_ID Plan Execution
FROM oe_order_headers oh, Generation
oe_order_lines ol
WHERE
h.header_id=ol.header_id
Cost
Engine

Parser Query
Transformer
Explain Plan
• An execution plan defines how Oracle finds or writes
the data.
• A statement's execution plan is the sequence of
operations Oracle performs to run the statement.

• Things to look for in Explain Plan


– Full Table Scans
– Cartesian joins

You might also like