SlideShare a Scribd company logo
1 of 44
Applying a  Blockcentric Approach to Oracle Tuning Daniel W. Fink www.optimaldba.com
Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Trust, But Verify ,[object Object],[object Object],[object Object]
[object Object],[object Object]
What is the Blockcentric Approach? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Oracle’s I/O Subsytem ,[object Object],[object Object],[object Object]
Blocks not Rows ,[object Object],[object Object]
Logical I/O ,[object Object],[object Object],[object Object]
Physical I/O ,[object Object],[object Object],[object Object]
Full Scans ,[object Object],[object Object],[object Object],[object Object],[object Object]
High Water Mark ,[object Object],[object Object],[object Object]
High Water Mark H D D D D HWM
Myths and Fallacies ,[object Object],[object Object],[object Object],[object Object],[object Object]
Buffer Cache Hit Ratio ,[object Object],[object Object],[object Object],[object Object]
Higher Is Not Always Better ,[object Object],[object Object],[object Object]
BCHR Method ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What Happens When 99% Is Not Good Enough? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Memory Speed Fallacy ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Determining True Cost of Statements ,[object Object],[object Object],[object Object],[object Object]
Blockcentric Method ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
% Of Rows Returned ,[object Object],[object Object],[object Object]
Index Usage ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Number Of Blocks Returned ,[object Object],[object Object],[object Object],[object Object],[object Object]
Scattered Data ,[object Object],H
Pop Quiz  1 ,[object Object],[object Object],[object Object]
Clustered Data ,[object Object],H
Fragmented Data ,[object Object],H D D D D D D
Pop Quiz  2 ,[object Object],[object Object],[object Object]
High Water Mark H D D D D HWM
Pop Quiz  3 ,[object Object],[object Object],[object Object]
Continued Data ,[object Object],[object Object]
Index all WHERE Columns ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Full Table Scans are BAD ,[object Object],[object Object],[object Object],[object Object],[object Object]
Determining Block Selectivity ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DUAL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Miscellaneous Tuning Tips ,[object Object],[object Object],[object Object],[object Object],[object Object]
Focus on overall length of operations ,[object Object],[object Object],[object Object],[object Object]
Reduce the I/Os ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Identify resource intensive SQL –  tune it first ,[object Object],[object Object],[object Object],[object Object]
Table and Index Maintenance ,[object Object],[object Object],[object Object],[object Object],[object Object]
Extent Sizing ,[object Object],[object Object],[object Object],[object Object]
Sources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Training Days 2003 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object]

More Related Content

Similar to Applyinga blockcentricapproachtotuning

Applyinga blockcentricapproach
Applyinga blockcentricapproachApplyinga blockcentricapproach
Applyinga blockcentricapproachoracle documents
 
Building High Performance MySQL Query Systems and Analytic Applications
Building High Performance MySQL Query Systems and Analytic ApplicationsBuilding High Performance MySQL Query Systems and Analytic Applications
Building High Performance MySQL Query Systems and Analytic ApplicationsCalpont
 
Building High Performance MySql Query Systems And Analytic Applications
Building High Performance MySql Query Systems And Analytic ApplicationsBuilding High Performance MySql Query Systems And Analytic Applications
Building High Performance MySql Query Systems And Analytic Applicationsguest40cda0b
 
Inside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTPInside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTPBob Ward
 
Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008paulguerin
 
The thinking persons guide to data warehouse design
The thinking persons guide to data warehouse designThe thinking persons guide to data warehouse design
The thinking persons guide to data warehouse designCalpont
 
Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008paulguerin
 
Metric Abuse: Frequently Misused Metrics in Oracle
Metric Abuse: Frequently Misused Metrics in OracleMetric Abuse: Frequently Misused Metrics in Oracle
Metric Abuse: Frequently Misused Metrics in OracleSteve Karam
 
Cost Based Optimizer - Part 1 of 2
Cost Based Optimizer - Part 1 of 2Cost Based Optimizer - Part 1 of 2
Cost Based Optimizer - Part 1 of 2Mahesh Vallampati
 
Database Core performance principles
Database Core performance principlesDatabase Core performance principles
Database Core performance principlesKoppelaars
 
Automated Testing with Databases
Automated Testing with DatabasesAutomated Testing with Databases
Automated Testing with Databaseselliando dias
 
White Paper for OMG! Identifying and Refactoring Common SQL...
White Paper for OMG! Identifying and Refactoring Common SQL...White Paper for OMG! Identifying and Refactoring Common SQL...
White Paper for OMG! Identifying and Refactoring Common SQL...Jeff Jacobs
 
I/O & virtualization performance with a search engine based on an xml databa...
 I/O & virtualization performance with a search engine based on an xml databa... I/O & virtualization performance with a search engine based on an xml databa...
I/O & virtualization performance with a search engine based on an xml databa...lucenerevolution
 
SQL Server In-Memory OLTP introduction (Hekaton)
SQL Server In-Memory OLTP introduction (Hekaton)SQL Server In-Memory OLTP introduction (Hekaton)
SQL Server In-Memory OLTP introduction (Hekaton)Shy Engelberg
 
שבוע אורקל 2016
שבוע אורקל 2016שבוע אורקל 2016
שבוע אורקל 2016Aaron Shilo
 
Performance By Design
Performance By DesignPerformance By Design
Performance By DesignGuy Harrison
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Aaron Shilo
 

Similar to Applyinga blockcentricapproachtotuning (20)

Applyinga blockcentricapproach
Applyinga blockcentricapproachApplyinga blockcentricapproach
Applyinga blockcentricapproach
 
Building High Performance MySQL Query Systems and Analytic Applications
Building High Performance MySQL Query Systems and Analytic ApplicationsBuilding High Performance MySQL Query Systems and Analytic Applications
Building High Performance MySQL Query Systems and Analytic Applications
 
Building High Performance MySql Query Systems And Analytic Applications
Building High Performance MySql Query Systems And Analytic ApplicationsBuilding High Performance MySql Query Systems And Analytic Applications
Building High Performance MySql Query Systems And Analytic Applications
 
Inside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTPInside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTP
 
Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008
 
SQL Server 2012 Best Practices
SQL Server 2012 Best PracticesSQL Server 2012 Best Practices
SQL Server 2012 Best Practices
 
The thinking persons guide to data warehouse design
The thinking persons guide to data warehouse designThe thinking persons guide to data warehouse design
The thinking persons guide to data warehouse design
 
Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008
 
Supporting SQLserver
Supporting SQLserverSupporting SQLserver
Supporting SQLserver
 
Metric Abuse: Frequently Misused Metrics in Oracle
Metric Abuse: Frequently Misused Metrics in OracleMetric Abuse: Frequently Misused Metrics in Oracle
Metric Abuse: Frequently Misused Metrics in Oracle
 
Cost Based Optimizer - Part 1 of 2
Cost Based Optimizer - Part 1 of 2Cost Based Optimizer - Part 1 of 2
Cost Based Optimizer - Part 1 of 2
 
Database Core performance principles
Database Core performance principlesDatabase Core performance principles
Database Core performance principles
 
Automated Testing with Databases
Automated Testing with DatabasesAutomated Testing with Databases
Automated Testing with Databases
 
White Paper for OMG! Identifying and Refactoring Common SQL...
White Paper for OMG! Identifying and Refactoring Common SQL...White Paper for OMG! Identifying and Refactoring Common SQL...
White Paper for OMG! Identifying and Refactoring Common SQL...
 
I/O & virtualization performance with a search engine based on an xml databa...
 I/O & virtualization performance with a search engine based on an xml databa... I/O & virtualization performance with a search engine based on an xml databa...
I/O & virtualization performance with a search engine based on an xml databa...
 
SQL Server In-Memory OLTP introduction (Hekaton)
SQL Server In-Memory OLTP introduction (Hekaton)SQL Server In-Memory OLTP introduction (Hekaton)
SQL Server In-Memory OLTP introduction (Hekaton)
 
שבוע אורקל 2016
שבוע אורקל 2016שבוע אורקל 2016
שבוע אורקל 2016
 
Performance By Design
Performance By DesignPerformance By Design
Performance By Design
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
Database
DatabaseDatabase
Database
 

More from oracle documents (20)

Windowsosauthent
WindowsosauthentWindowsosauthent
Windowsosauthent
 
Whatistnsnames
WhatistnsnamesWhatistnsnames
Whatistnsnames
 
Whatisadatabaselink
WhatisadatabaselinkWhatisadatabaselink
Whatisadatabaselink
 
Varraysandnestedtables
VarraysandnestedtablesVarraysandnestedtables
Varraysandnestedtables
 
Usertracing
UsertracingUsertracing
Usertracing
 
Userpasswrd
UserpasswrdUserpasswrd
Userpasswrd
 
Userlimit
UserlimitUserlimit
Userlimit
 
Undo internalspresentation
Undo internalspresentationUndo internalspresentation
Undo internalspresentation
 
Undo internals paper
Undo internals paperUndo internals paper
Undo internals paper
 
Tablespacelmt
TablespacelmtTablespacelmt
Tablespacelmt
 
Tablerename
TablerenameTablerename
Tablerename
 
Sql scripting sorcerypresentation
Sql scripting sorcerypresentationSql scripting sorcerypresentation
Sql scripting sorcerypresentation
 
Sql scripting sorcerypaper
Sql scripting sorcerypaperSql scripting sorcerypaper
Sql scripting sorcerypaper
 
Sql for dbaspresentation
Sql for dbaspresentationSql for dbaspresentation
Sql for dbaspresentation
 
Sequencereset
SequenceresetSequencereset
Sequencereset
 
Rollbacksizes
RollbacksizesRollbacksizes
Rollbacksizes
 
Rollbackshrinks
RollbackshrinksRollbackshrinks
Rollbackshrinks
 
Rollbacklmt
RollbacklmtRollbacklmt
Rollbacklmt
 
Rollbackblocking
RollbackblockingRollbackblocking
Rollbackblocking
 
Rollback1555s
Rollback1555sRollback1555s
Rollback1555s
 

Applyinga blockcentricapproachtotuning

  • 1. Applying a Blockcentric Approach to Oracle Tuning Daniel W. Fink www.optimaldba.com
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. High Water Mark H D D D D HWM
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29. High Water Mark H D D D D HWM
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.

Editor's Notes

  1. This is a very high level presentation. Intended to offer new ideas, a new approach. This
  2. Use the ideas here to begin to examine your systems. Each db system will have nuances that need to be addressed.
  3. A request for a single byte column in a single row will result in the entire block being accessed.
  4. A request for a single byte column in a single row will result in the entire block being accessed.
  5. Try this. Insert 1 million rows into an empty table, but rollback. Then do a select * from the table. Then truncate the table and rerun the query. Truncate resets the HWM.
  6. Statement 1 - Cost = 5100 + (100 * 10000) = 1,005,100 Statement 2 - Cost = 400 + (200 * 10000) = 2,000,400
  7. 65 blocks below HWM 200 rows per block 13,000 rows Query selects 100 rows or .77% of the rows Query reads 53 blocks or 82% of the blocks
  8. 65 blocks below HWM 200 rows per block 13,000 rows Query selects 100 rows or .77% of the rows Query reads 7 blocks or 11% of the blocks
  9. 65 blocks below HWM, but only 6 contain data 200 rows per block 1200 rows Query selects 1200 rows or 100% of the rows Query reads 6 blocks or 10% of the blocks
  10. How do you determine the # of blocks containing data? Not straightforward, if rows are chained or have migrated. Using dbms_rowid only returns the ‘head’ piece for a continued row.