Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A 12Step Program
EXAMINE THE
EXECUTION PLAN
Examine cost,
row count and
time
Dont use
explain plans
2
1
Find the
expensive
operators
Know table
relationships (avoid
duplicating efforts
later on)
REVIEW EXISTING
KEYS AND
CONSTRAINTS
RE-RUN
THE QUERY
What is primary
key definition?
Nested loop/
merge/hash joins
Out-of-date
statistics can impact
performance
Seeks vs scanswhich
is more expensive in this
scenario?
TUNE
THE QUERY
Gather average
execution times
Capture wait
events
Focus on
most expensive
operations first
Know if histograms or
baselines are being
used; get sample bind
variable values
TIP
Focus on logical
I/Os (number of
logical reads)
RE-RUN
THE QUERY
11
Make small
changes
GATHER TABLE
INFORMATION
TIP
SARG-able
(need index?)
Know order of
columns and their
selectivity
Record the
time, logical I/O
and wait events,
and compare
with initial
baseline
Review current
statistics
Avoid sub-queries
Review table
definitions
Get index
definition
Know when
predicate is applied
(should be earlier
rather than later)
Get actual
row counts
for each step
EVALUATE
EXISTING
INDEXES
ANALYZE
COLUMNS IN
WHERE CLAUSE
LOOK FOR
PERFORMANCE
INHIBITORS
10
Reduce
logical I/O
Join/query/table hints
12
Abuse of wildcards (*)
pulling back too many
rows
Scalar functions
Code-based SQL
generators (e.g. EMF,
LNO, Hibernate)
Find and fix query performance faster with SolarWinds Database Performance Analyzer. Free 14-day trial at: www.solarwinds.com/dpa-oracle-download
2014 Confio Software, a SolarWinds company. All rights reserved.