Day 1: Introduction to SQL
Optimization
1 1:
Inside the Oracle
Optimizer
Job of the SQL optimizer
Parsing, semantic check, decision tree, generating plan
How the Oracle optimizer chooses the best: execution plan
The Oracle Optimizer SQL cache (library cache)
1 2:
Oracle optimization goals
The Oracle Optimizer: Rule Based Optimization
The Oracle Optimizer: Cost Based Optimization
The all_rows vs first_rows_n optimizer modes
Generating optimizer Statistics for tables and system
1 3: Table Join internals
Oracle Joins, Join Methods and Access Paths
Nested loops, hash joins, merge joins
The star transformation
1-4: Evaluating full-table
scans
Understanding multi-block reads (db_file_scattered_reads)
Threshold between full table scan and index range scan
Parallelizing full-table scans
When full table scans are evil
Using plan91.sql and plan10g.sql
1 5: Oracle Index Optimization
Oracle Index types
Index cardinality
SQL with multi-column indexes
SQL with bitmap indexes
Index unique scans vs. index range scans
Finding missing indexes
1 6: Oracle rowset sorting
When a sort is invoked (order by, group by, etc.)
Sorting with indexes vs internal sorting
Detecting disk sorts
Day 2: SQL Execution plan
evaluation
2-1:
The Goals of SQL tuning
Evaluate large-table full-table scans
Evaluate table join order
Evaluate index access
2 - 2: Exposing the SQL execution plans
The autotrace command
Using the explain plan facility
2 - 3:
Reading an execution plan
Evaluating the steps of an execution plan
The cost and cardinality columns of an execution plan
Adding RAM usage details to an execution plan
2 4: Tracing SQL execution
plans:
Using TKPROF
Using the 10046 trace event
2 5:
Changing SQL: execution plans
Using optimizer directives (hints)
Changing plans with histograms
Changing plans with dynamic sampling
2 - 6: Freezing execution plans:
Freezing plans with multiple hints
Using optimizer plan stability
Using SQL profiles
|
Day 3: Advanced SQL Tuning Topics
3 1: Using hints effectively in SQL
Good Hints vs. Bad Hints
Global hints (Optimizer mode hints)
Index hints
Parameter change hints
3 2: Measuring SQL performance
Measuring end-to-end response time
Measuring SQL throughput
Using v$session_longops
3 3: SQL tuning with temporary objects
Using the WITH clause
Using global temporary tables
Re-writing SQL in PL/SQL
3 4: Tuning subqueries
Tuning IN and NOT IN subqueries
Tuning EXISTS subqueries
Tuning correlated subqueries
Using subquery hints (push_subq)
3 5: Tuning SQL with
cardinality estimates and histograms
Height vs weight balanced histograms
Skew and histograms
Overhead of histograms
Histograms for foreign & primary keys
Histograms for FBIs
Tuning with cardinality estimation
3 6:
Oracle SQL tuning secrets
Disk I/O and SQL optimization
Network and SQL optimization (SQL*Net roundtrips)
Diagnosing network issues
CPU vs I/O optimizer coasting
Using gather_system_stats
|