You are on page 1of 13

Oracle Performance

Tuning

Presented By :
G.A.Dilruk

Agenda

Oracle Tuning Overview

Two Types of Oracle Tuning

SQL Tuning Overview

SQL Tuning Steps

Writing Better SQL Statements

Using Indexes

Oracle Tuning Overview


Effective

data collection and analysis


is essential for identifying and
correcting performance problems.

Low

hardware will affect response


time but wise versa is not true always.

Increasing

number of session pool will


increase performance too.

Two Types of Oracle


Tuning
Instance
SQL

Tuning

Tuning

SQL Tuning Overview


The

goals of SQL tuning involve


verifying the best execution plan for
any statements.

Oracle

support both automatic and


manual tuning.

Considering

End User Response Time


and Server Resource Usage.

SQL Tuning Overview

If you INSERT into a table with three indexes, then it will be


approximately 10 times slower than an INSERT into a table with
no indexes.

The worst type of view use is when a view references other


views, and when they are joined in queries.

If you want SQL to accomplish different things, then write


various statements.

Rewriting an inefficient SQL statement is easier than modifying


it.

Using triggers consumes system resources. If you use too many


triggers, then you can find that performance is adversely
affected.

SQL Tuning Steps


Identifying

high load or low performing


SQL statements (Ref Ex01).

Looking

and Verifying oracle execution


plan (Ref Ex02).

Implementing
Repeating

corrective action.

above steps.

How Oracle Plan SQL


Execution
Gather

data statistics (oracle support


both automatic and manual data
gathering) (Ref Ex03).

Query

optimizer looking collected data


and plan better execution.

Writing Better SQL Statements


Get

only required columns in the select statement.

Use

untransformed column values in WHERE clauses


as much as possible.

Beware

of implicit type conversions.

Combine
Use

Multiples Scans with CASE Statements.

DML with RETURNING Clause.

Modify

All the Data Needed in Single SQL Statement.

Writing Better SQL Statements


Using Indexes
Do

not build indexes unless necessary.

Consider

indexing keys that are used frequently in WHERE

clauses.
Consider

indexing keys that are used frequently to join


tables in SQL statements.

Columns

that are frequently update are bad for indexing.

Columns

that have long character strings are bad for

indexing.
Do

not index keys that appear only in WHERE clauses with


functions or operators.

Writing Better SQL Statements


Index Types
Oracle

includes numerous data structures to improve


the speed of Oracle SQL queries.

B-Tree

Indexes are the most popular common index

type.
Create
Use
Use

composite indexes with correct column ordering.

Bitmap Indexes for Performance.

function-based index either in transformed columns


or in an expression.

Q&A

Thanks

You might also like