SlideShare a Scribd company logo
1 of 56
SQL Optimization (Tuning) with 10046 Trace Data and DBMS_XPLAN Hotsos Enterprises, Ltd. Grapevine, Texas Oracle. Performance. Now. [email_address]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
About the Speaker ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Goals of SQL Tuning or Optimization
Goal of SQL Tuning or Optimization ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Approach for SQL Optimization
A Historical Perspective ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
An Alternative Approach: An Actual Method for SQL Optimization ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Benefits of the Method ,[object Object],[object Object]
10046 Trace Data and STAT Lines
Event 10046 instructs the Oracle kernel to emit a sequential record of what it does with your time. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
STAT Lines ,[object Object],[object Object],[object Object],[object Object],[object Object]
STAT Lines and STATISTICS_LEVEL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
STATISTICS_LEVEL
STATISTICS_LEVEL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
STATISTICS_LEVEL ,[object Object],[object Object],[object Object],[object Object]
STATISTICS_LEVEL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
STAT Lines Continued…
Script to Gather Row Source Execution Statistics ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Instead of disabling trace, just disconnect Turning off trace before cursor close withholds the cursor’s execution plan information
Real Life STAT Lines ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
STAT Lines Description STAT #6  id=9  cnt=159  pid=4  pos=2  obj=19  op='TABLE ACCESS BY INDEX ROWID IND$  (cr=332  pr=1  pw=0  time=33601 us)' Cursor Number The unique id of the row source operation within the STAT line set Number of rows returned by this row source operation Parent “id” for this row source operation Position of child within parent object_id of the row source operation (object_id from dba_objects). Set to 0 for non-object row source operations like nested loops etc. Name of the row source operation Consistent Reads Physical Reads (r in 9i) Physical Writes (w in 9i) Elapsed duration in microseconds  including descendants
11g STAT Lines Enhancement ,[object Object],[object Object],[object Object],[object Object]
Hotsos way of Looking at STAT lines “Profile of Execution Plan” Blue Rectangle – Cumulative Duration (time) in STAT lines Green Rectangle – Duration of Individual STAT lines calculated by profiler software op (obj)  (cnt) (cr) (pw) (pr) (time) (calculated)
Recap ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DBMS_XPLAN
DBMS_XPLAN ,[object Object],[object Object],[object Object],[object Object]
DBMS_XPLAN ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Using DBMS_XPLAN ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DBMS_XPLAN.DISPLAY Options ,[object Object],[object Object],[object Object],[object Object],[object Object]
DBMS_XPLAN. DISPLAY Examples ,[object Object],[object Object],[object Object],[object Object],[object Object]
DBMS_XPLAN.TYPICAL Output
Recap ,[object Object],[object Object],[object Object]
Method R
Method R ,[object Object],[object Object],[object Object],[object Object],[object Object],Page 20 –Optimizing Oracle Performance – Cary Millsap and Jeff Holt, O’Reilly Books
Method R ,[object Object],[object Object],[object Object]
Method R Applied to STAT lines and EXPLAIN PLAN
EXPLAIN PLAN and STAT Lines (Execution Plan) Side by Side
First Question ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Apply Method R to this Profiler View of STAT Lines ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Method R view of STAT lines and EXPLAIN PLAN Notice wide difference in row count estimated by the plan and the actual
Recap ,[object Object],[object Object],[object Object]
Why not use LIO’s instead of timing of the row source operation?
LIO’s as a driving approach  ,[object Object],[object Object],[object Object],[object Object]
A note of caution: LIO Versus PIO
A Note of Caution (LIO Versus PIO) In the lines that are highlighted, what % of the time was due  to physical I/O and not logical I/Os?
LIO Versus PIO ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
LIO Versus PIO ,[object Object],[object Object],[object Object],[object Object]
LIO Versus PIO ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Real World Example
Real World Example – SQL Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Profiler View of Execution Plan ,[object Object],[object Object],[object Object]
DBMS_XPLAN
SQL Statement – Access Predicates Highlighted ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Recap ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Next Steps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Q & Q  U  E  S  T  I  O  N  S A  N  S  W  E  R  S

More Related Content

What's hot

Part2 Best Practices for Managing Optimizer Statistics
Part2 Best Practices for Managing Optimizer StatisticsPart2 Best Practices for Managing Optimizer Statistics
Part2 Best Practices for Managing Optimizer StatisticsMaria Colgan
 
Part3 Explain the Explain Plan
Part3 Explain the Explain PlanPart3 Explain the Explain Plan
Part3 Explain the Explain PlanMaria Colgan
 
How to understand and analyze Apache Hive query execution plan for performanc...
How to understand and analyze Apache Hive query execution plan for performanc...How to understand and analyze Apache Hive query execution plan for performanc...
How to understand and analyze Apache Hive query execution plan for performanc...DataWorks Summit/Hadoop Summit
 
Part4 Influencing Execution Plans with Optimizer Hints
Part4 Influencing Execution Plans with Optimizer HintsPart4 Influencing Execution Plans with Optimizer Hints
Part4 Influencing Execution Plans with Optimizer HintsMaria Colgan
 
8 query processing and optimization
8 query processing and optimization8 query processing and optimization
8 query processing and optimizationKumar
 
How to analyze and tune sql queries for better performance vts2016
How to analyze and tune sql queries for better performance vts2016How to analyze and tune sql queries for better performance vts2016
How to analyze and tune sql queries for better performance vts2016oysteing
 
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better PerformanceHow to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performanceoysteing
 
Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query ProcessingMythili Kannan
 
Managing Statistics for Optimal Query Performance
Managing Statistics for Optimal Query PerformanceManaging Statistics for Optimal Query Performance
Managing Statistics for Optimal Query PerformanceKaren Morton
 
Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimizationWBUTTUTORIALS
 
Efficient spatial queries on vanilla databases
Efficient spatial queries on vanilla databasesEfficient spatial queries on vanilla databases
Efficient spatial queries on vanilla databasesJulian Hyde
 
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory optionStar Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory optionFranck Pachot
 
Stacks
StacksStacks
StacksAcad
 
Heuristic approch monika sanghani
Heuristic approch  monika sanghaniHeuristic approch  monika sanghani
Heuristic approch monika sanghaniMonika Sanghani
 
Table partitioning in PostgreSQL + Rails
Table partitioning in PostgreSQL + RailsTable partitioning in PostgreSQL + Rails
Table partitioning in PostgreSQL + RailsAgnieszka Figiel
 
Phases of distributed query processing
Phases of distributed query processingPhases of distributed query processing
Phases of distributed query processingNevil Dsouza
 
02 database oprimization - improving sql performance - ent-db
02  database oprimization - improving sql performance - ent-db02  database oprimization - improving sql performance - ent-db
02 database oprimization - improving sql performance - ent-dbuncleRhyme
 

What's hot (20)

Part2 Best Practices for Managing Optimizer Statistics
Part2 Best Practices for Managing Optimizer StatisticsPart2 Best Practices for Managing Optimizer Statistics
Part2 Best Practices for Managing Optimizer Statistics
 
Part3 Explain the Explain Plan
Part3 Explain the Explain PlanPart3 Explain the Explain Plan
Part3 Explain the Explain Plan
 
How to understand and analyze Apache Hive query execution plan for performanc...
How to understand and analyze Apache Hive query execution plan for performanc...How to understand and analyze Apache Hive query execution plan for performanc...
How to understand and analyze Apache Hive query execution plan for performanc...
 
Part4 Influencing Execution Plans with Optimizer Hints
Part4 Influencing Execution Plans with Optimizer HintsPart4 Influencing Execution Plans with Optimizer Hints
Part4 Influencing Execution Plans with Optimizer Hints
 
8 query processing and optimization
8 query processing and optimization8 query processing and optimization
8 query processing and optimization
 
How to analyze and tune sql queries for better performance vts2016
How to analyze and tune sql queries for better performance vts2016How to analyze and tune sql queries for better performance vts2016
How to analyze and tune sql queries for better performance vts2016
 
Query compiler
Query compilerQuery compiler
Query compiler
 
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better PerformanceHow to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performance
 
Query processing
Query processingQuery processing
Query processing
 
Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query Processing
 
Managing Statistics for Optimal Query Performance
Managing Statistics for Optimal Query PerformanceManaging Statistics for Optimal Query Performance
Managing Statistics for Optimal Query Performance
 
Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimization
 
Efficient spatial queries on vanilla databases
Efficient spatial queries on vanilla databasesEfficient spatial queries on vanilla databases
Efficient spatial queries on vanilla databases
 
Query processing
Query processingQuery processing
Query processing
 
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory optionStar Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
 
Stacks
StacksStacks
Stacks
 
Heuristic approch monika sanghani
Heuristic approch  monika sanghaniHeuristic approch  monika sanghani
Heuristic approch monika sanghani
 
Table partitioning in PostgreSQL + Rails
Table partitioning in PostgreSQL + RailsTable partitioning in PostgreSQL + Rails
Table partitioning in PostgreSQL + Rails
 
Phases of distributed query processing
Phases of distributed query processingPhases of distributed query processing
Phases of distributed query processing
 
02 database oprimization - improving sql performance - ent-db
02  database oprimization - improving sql performance - ent-db02  database oprimization - improving sql performance - ent-db
02 database oprimization - improving sql performance - ent-db
 

Viewers also liked

Transformatie door innovatie IGC Amsterdam
Transformatie door innovatie IGC AmsterdamTransformatie door innovatie IGC Amsterdam
Transformatie door innovatie IGC AmsterdamPiet van Vugt
 
Undangan (Kak Melly n Kak Dicky)
Undangan (Kak Melly n Kak Dicky)Undangan (Kak Melly n Kak Dicky)
Undangan (Kak Melly n Kak Dicky)@rtNya
 
Approximate Thin Plate Spline Mappings
Approximate Thin Plate Spline MappingsApproximate Thin Plate Spline Mappings
Approximate Thin Plate Spline MappingsArchzilon Eshun-Davies
 
Export Compliance: Keeping You Safe, Solvent + Out of Trouble
Export Compliance: Keeping You Safe, Solvent + Out of TroubleExport Compliance: Keeping You Safe, Solvent + Out of Trouble
Export Compliance: Keeping You Safe, Solvent + Out of TroubleKegler Brown Hill + Ritter
 
The critical role of the manager in supporting learning at work through coach...
The critical role of the manager in supporting learning at work through coach...The critical role of the manager in supporting learning at work through coach...
The critical role of the manager in supporting learning at work through coach...Acas Comms
 
Lakewood Lodge Information
Lakewood Lodge Information Lakewood Lodge Information
Lakewood Lodge Information Takahe One
 
شرائح التغيير
شرائح التغييرشرائح التغيير
شرائح التغييرAhmad Darwish
 
Social Media Overview
Social Media OverviewSocial Media Overview
Social Media Overviewguest1dcfeb1
 
Optimizing Your Receivables: Using Lessons From Trying Times
Optimizing Your Receivables: Using Lessons From Trying TimesOptimizing Your Receivables: Using Lessons From Trying Times
Optimizing Your Receivables: Using Lessons From Trying TimesKegler Brown Hill + Ritter
 
NABE Communication Section Workshop - Event Information & Registration
NABE Communication Section Workshop - Event Information & RegistrationNABE Communication Section Workshop - Event Information & Registration
NABE Communication Section Workshop - Event Information & RegistrationStephanie Abbott
 
Section 1031 For Pros Handbook
Section 1031 For Pros HandbookSection 1031 For Pros Handbook
Section 1031 For Pros HandbookEdmund_Wheeler
 
Ekonomik i̇stikrar
Ekonomik i̇stikrarEkonomik i̇stikrar
Ekonomik i̇stikrarsadettin
 
MoMoTLV Israel March 2010 - innerActive - appstores & in-app advertising
MoMoTLV Israel March 2010 - innerActive - appstores & in-app advertisingMoMoTLV Israel March 2010 - innerActive - appstores & in-app advertising
MoMoTLV Israel March 2010 - innerActive - appstores & in-app advertisingMobileMonday Tel-Aviv
 
Rachel Wolfe Photography Features
Rachel Wolfe Photography FeaturesRachel Wolfe Photography Features
Rachel Wolfe Photography FeaturesRachel Wolfe
 
pl_global-powers-cons-products-2015
pl_global-powers-cons-products-2015pl_global-powers-cons-products-2015
pl_global-powers-cons-products-2015Blossom Out
 
BOSC 2012 panel discussion
BOSC 2012 panel discussionBOSC 2012 panel discussion
BOSC 2012 panel discussionc.titus.brown
 

Viewers also liked (20)

Transformatie door innovatie IGC Amsterdam
Transformatie door innovatie IGC AmsterdamTransformatie door innovatie IGC Amsterdam
Transformatie door innovatie IGC Amsterdam
 
Undangan (Kak Melly n Kak Dicky)
Undangan (Kak Melly n Kak Dicky)Undangan (Kak Melly n Kak Dicky)
Undangan (Kak Melly n Kak Dicky)
 
Social Media 101
Social Media 101Social Media 101
Social Media 101
 
Approximate Thin Plate Spline Mappings
Approximate Thin Plate Spline MappingsApproximate Thin Plate Spline Mappings
Approximate Thin Plate Spline Mappings
 
Rscrirg
RscrirgRscrirg
Rscrirg
 
Export Compliance: Keeping You Safe, Solvent + Out of Trouble
Export Compliance: Keeping You Safe, Solvent + Out of TroubleExport Compliance: Keeping You Safe, Solvent + Out of Trouble
Export Compliance: Keeping You Safe, Solvent + Out of Trouble
 
The critical role of the manager in supporting learning at work through coach...
The critical role of the manager in supporting learning at work through coach...The critical role of the manager in supporting learning at work through coach...
The critical role of the manager in supporting learning at work through coach...
 
2014 ucl
2014 ucl2014 ucl
2014 ucl
 
Lakewood Lodge Information
Lakewood Lodge Information Lakewood Lodge Information
Lakewood Lodge Information
 
شرائح التغيير
شرائح التغييرشرائح التغيير
شرائح التغيير
 
Social Media Overview
Social Media OverviewSocial Media Overview
Social Media Overview
 
Optimizing Your Receivables: Using Lessons From Trying Times
Optimizing Your Receivables: Using Lessons From Trying TimesOptimizing Your Receivables: Using Lessons From Trying Times
Optimizing Your Receivables: Using Lessons From Trying Times
 
NABE Communication Section Workshop - Event Information & Registration
NABE Communication Section Workshop - Event Information & RegistrationNABE Communication Section Workshop - Event Information & Registration
NABE Communication Section Workshop - Event Information & Registration
 
Section 1031 For Pros Handbook
Section 1031 For Pros HandbookSection 1031 For Pros Handbook
Section 1031 For Pros Handbook
 
Ekonomik i̇stikrar
Ekonomik i̇stikrarEkonomik i̇stikrar
Ekonomik i̇stikrar
 
Br10 tilbygning
Br10 tilbygningBr10 tilbygning
Br10 tilbygning
 
MoMoTLV Israel March 2010 - innerActive - appstores & in-app advertising
MoMoTLV Israel March 2010 - innerActive - appstores & in-app advertisingMoMoTLV Israel March 2010 - innerActive - appstores & in-app advertising
MoMoTLV Israel March 2010 - innerActive - appstores & in-app advertising
 
Rachel Wolfe Photography Features
Rachel Wolfe Photography FeaturesRachel Wolfe Photography Features
Rachel Wolfe Photography Features
 
pl_global-powers-cons-products-2015
pl_global-powers-cons-products-2015pl_global-powers-cons-products-2015
pl_global-powers-cons-products-2015
 
BOSC 2012 panel discussion
BOSC 2012 panel discussionBOSC 2012 panel discussion
BOSC 2012 panel discussion
 

Similar to SQL Optimization With Trace Data And Dbms Xplan V6

Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsNirav Shah
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ICarlos Oliveira
 
Performance tuning
Performance tuningPerformance tuning
Performance tuningami111
 
Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...
Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...
Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...djkucera
 
Top 10 tips for Oracle performance
Top 10 tips for Oracle performanceTop 10 tips for Oracle performance
Top 10 tips for Oracle performanceGuy Harrison
 
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...djkucera
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuningYogiji Creations
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And Whatudaymoogala
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Alex Zaballa
 
Sql tuning guideline
Sql tuning guidelineSql tuning guideline
Sql tuning guidelineSidney Chen
 
Prog1 chap1 and chap 2
Prog1 chap1 and chap 2Prog1 chap1 and chap 2
Prog1 chap1 and chap 2rowensCap
 
Mysqlppt
MysqlpptMysqlppt
MysqlpptReka
 
SQL Tuning Overview
SQL Tuning OverviewSQL Tuning Overview
SQL Tuning OverviewKai Liu
 
Sydney Oracle Meetup - execution plans
Sydney Oracle Meetup - execution plansSydney Oracle Meetup - execution plans
Sydney Oracle Meetup - execution planspaulguerin
 

Similar to SQL Optimization With Trace Data And Dbms Xplan V6 (20)

Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
 
Using AWR for SQL Analysis
Using AWR for SQL AnalysisUsing AWR for SQL Analysis
Using AWR for SQL Analysis
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
 
Sherlock holmes for dba’s
Sherlock holmes for dba’sSherlock holmes for dba’s
Sherlock holmes for dba’s
 
Performance tuning
Performance tuningPerformance tuning
Performance tuning
 
Oracle SQL Tuning
Oracle SQL TuningOracle SQL Tuning
Oracle SQL Tuning
 
Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...
Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...
Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...
 
Top 10 tips for Oracle performance
Top 10 tips for Oracle performanceTop 10 tips for Oracle performance
Top 10 tips for Oracle performance
 
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuning
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
 
Sql tuning guideline
Sql tuning guidelineSql tuning guideline
Sql tuning guideline
 
Prog1 chap1 and chap 2
Prog1 chap1 and chap 2Prog1 chap1 and chap 2
Prog1 chap1 and chap 2
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
SQL Tuning Overview
SQL Tuning OverviewSQL Tuning Overview
SQL Tuning Overview
 
pm1
pm1pm1
pm1
 
Sydney Oracle Meetup - execution plans
Sydney Oracle Meetup - execution plansSydney Oracle Meetup - execution plans
Sydney Oracle Meetup - execution plans
 

More from Mahesh Vallampati

Operating a payables shared service organization in oracle cloud oow 2019_v4
Operating a payables shared service organization in oracle cloud oow 2019_v4Operating a payables shared service organization in oracle cloud oow 2019_v4
Operating a payables shared service organization in oracle cloud oow 2019_v4Mahesh Vallampati
 
Oracle BI Publisher to Transform Cloud ERP Reports
Oracle BI Publisher to Transform Cloud ERP ReportsOracle BI Publisher to Transform Cloud ERP Reports
Oracle BI Publisher to Transform Cloud ERP ReportsMahesh Vallampati
 
Cloudy with a chance of 1099
Cloudy with a chance of 1099Cloudy with a chance of 1099
Cloudy with a chance of 1099Mahesh Vallampati
 
Statistical Accounts and Data in Oracle Cloud General Ledger
Statistical Accounts and Data in Oracle Cloud General LedgerStatistical Accounts and Data in Oracle Cloud General Ledger
Statistical Accounts and Data in Oracle Cloud General LedgerMahesh Vallampati
 
Sparse Matrix Manipulation Made easy in an Oracle RDBMS
Sparse Matrix Manipulation Made easy in an Oracle RDBMSSparse Matrix Manipulation Made easy in an Oracle RDBMS
Sparse Matrix Manipulation Made easy in an Oracle RDBMSMahesh Vallampati
 
The Data Architect Manifesto
The Data Architect ManifestoThe Data Architect Manifesto
The Data Architect ManifestoMahesh Vallampati
 
Oracle EBS Change Projects Process Flows
Oracle EBS Change Projects Process FlowsOracle EBS Change Projects Process Flows
Oracle EBS Change Projects Process FlowsMahesh Vallampati
 
Enough Blame for System Performance Issues
Enough Blame for System Performance IssuesEnough Blame for System Performance Issues
Enough Blame for System Performance IssuesMahesh Vallampati
 
Oracle R12 12.1.3 Legal Entity Data Gathering Template
Oracle R12 12.1.3 Legal Entity Data Gathering TemplateOracle R12 12.1.3 Legal Entity Data Gathering Template
Oracle R12 12.1.3 Legal Entity Data Gathering TemplateMahesh Vallampati
 
ERP Manager meets SDLC and CMMI
ERP Manager meets SDLC and CMMIERP Manager meets SDLC and CMMI
ERP Manager meets SDLC and CMMIMahesh Vallampati
 
Oracle 11i OID AD Integration
Oracle 11i OID AD IntegrationOracle 11i OID AD Integration
Oracle 11i OID AD IntegrationMahesh Vallampati
 
Generic Backup and Restore Process
Generic Backup and Restore ProcessGeneric Backup and Restore Process
Generic Backup and Restore ProcessMahesh Vallampati
 
ITP Instance Management Process V2
ITP Instance Management Process V2ITP Instance Management Process V2
ITP Instance Management Process V2Mahesh Vallampati
 

More from Mahesh Vallampati (20)

Operating a payables shared service organization in oracle cloud oow 2019_v4
Operating a payables shared service organization in oracle cloud oow 2019_v4Operating a payables shared service organization in oracle cloud oow 2019_v4
Operating a payables shared service organization in oracle cloud oow 2019_v4
 
Oracle BI Publisher to Transform Cloud ERP Reports
Oracle BI Publisher to Transform Cloud ERP ReportsOracle BI Publisher to Transform Cloud ERP Reports
Oracle BI Publisher to Transform Cloud ERP Reports
 
Cloudy with a chance of 1099
Cloudy with a chance of 1099Cloudy with a chance of 1099
Cloudy with a chance of 1099
 
Banking on the Cloud
Banking on the CloudBanking on the Cloud
Banking on the Cloud
 
Statistical Accounts and Data in Oracle Cloud General Ledger
Statistical Accounts and Data in Oracle Cloud General LedgerStatistical Accounts and Data in Oracle Cloud General Ledger
Statistical Accounts and Data in Oracle Cloud General Ledger
 
Sparse Matrix Manipulation Made easy in an Oracle RDBMS
Sparse Matrix Manipulation Made easy in an Oracle RDBMSSparse Matrix Manipulation Made easy in an Oracle RDBMS
Sparse Matrix Manipulation Made easy in an Oracle RDBMS
 
The Data Architect Manifesto
The Data Architect ManifestoThe Data Architect Manifesto
The Data Architect Manifesto
 
Five pillars of competency
Five pillars of competencyFive pillars of competency
Five pillars of competency
 
Oracle EBS Change Projects Process Flows
Oracle EBS Change Projects Process FlowsOracle EBS Change Projects Process Flows
Oracle EBS Change Projects Process Flows
 
Cutover plan template Tool
Cutover plan template ToolCutover plan template Tool
Cutover plan template Tool
 
CRM Lead Lifecycle Process
CRM Lead Lifecycle ProcessCRM Lead Lifecycle Process
CRM Lead Lifecycle Process
 
Enough Blame for System Performance Issues
Enough Blame for System Performance IssuesEnough Blame for System Performance Issues
Enough Blame for System Performance Issues
 
Oracle R12 12.1.3 Legal Entity Data Gathering Template
Oracle R12 12.1.3 Legal Entity Data Gathering TemplateOracle R12 12.1.3 Legal Entity Data Gathering Template
Oracle R12 12.1.3 Legal Entity Data Gathering Template
 
ERP Manager meets SDLC and CMMI
ERP Manager meets SDLC and CMMIERP Manager meets SDLC and CMMI
ERP Manager meets SDLC and CMMI
 
Oracle 11i OID AD Integration
Oracle 11i OID AD IntegrationOracle 11i OID AD Integration
Oracle 11i OID AD Integration
 
Generic Backup and Restore Process
Generic Backup and Restore ProcessGeneric Backup and Restore Process
Generic Backup and Restore Process
 
OIC Process Flow V7
OIC Process Flow V7OIC Process Flow V7
OIC Process Flow V7
 
XBRL in Oracle 11i and R12
XBRL in Oracle 11i and R12XBRL in Oracle 11i and R12
XBRL in Oracle 11i and R12
 
Sales Process Flow V4
Sales Process Flow V4Sales Process Flow V4
Sales Process Flow V4
 
ITP Instance Management Process V2
ITP Instance Management Process V2ITP Instance Management Process V2
ITP Instance Management Process V2
 

Recently uploaded

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

SQL Optimization With Trace Data And Dbms Xplan V6

  • 1. SQL Optimization (Tuning) with 10046 Trace Data and DBMS_XPLAN Hotsos Enterprises, Ltd. Grapevine, Texas Oracle. Performance. Now. [email_address]
  • 2.
  • 3.
  • 4. Goals of SQL Tuning or Optimization
  • 5.
  • 6. Approach for SQL Optimization
  • 7.
  • 8.
  • 9.
  • 10. 10046 Trace Data and STAT Lines
  • 11.
  • 12.
  • 13.
  • 15.
  • 16.
  • 17.
  • 19.
  • 20.
  • 21. STAT Lines Description STAT #6 id=9 cnt=159 pid=4 pos=2 obj=19 op='TABLE ACCESS BY INDEX ROWID IND$ (cr=332 pr=1 pw=0 time=33601 us)' Cursor Number The unique id of the row source operation within the STAT line set Number of rows returned by this row source operation Parent “id” for this row source operation Position of child within parent object_id of the row source operation (object_id from dba_objects). Set to 0 for non-object row source operations like nested loops etc. Name of the row source operation Consistent Reads Physical Reads (r in 9i) Physical Writes (w in 9i) Elapsed duration in microseconds including descendants
  • 22.
  • 23. Hotsos way of Looking at STAT lines “Profile of Execution Plan” Blue Rectangle – Cumulative Duration (time) in STAT lines Green Rectangle – Duration of Individual STAT lines calculated by profiler software op (obj) (cnt) (cr) (pw) (pr) (time) (calculated)
  • 24.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 32.
  • 34.
  • 35.
  • 36. Method R Applied to STAT lines and EXPLAIN PLAN
  • 37. EXPLAIN PLAN and STAT Lines (Execution Plan) Side by Side
  • 38.
  • 39.
  • 40. Method R view of STAT lines and EXPLAIN PLAN Notice wide difference in row count estimated by the plan and the actual
  • 41.
  • 42. Why not use LIO’s instead of timing of the row source operation?
  • 43.
  • 44. A note of caution: LIO Versus PIO
  • 45. A Note of Caution (LIO Versus PIO) In the lines that are highlighted, what % of the time was due to physical I/O and not logical I/Os?
  • 46.
  • 47.
  • 48.
  • 50.
  • 51.
  • 53.
  • 54.
  • 55.
  • 56. Q & Q U E S T I O N S A N S W E R S

Editor's Notes

  1. Method R It’s simply how humans optimize. Identify the important task. Measure its response time (R). In detail. Optimize R in the most economically efficient way. Repeat until system is economically optimal.