SlideShare a Scribd company logo
SQL Tuning Guideline Sidney · 2011 Feb 16
Agenda The Guideline to tune sql Application Logic Table/Column statistics SQL access path SQL join NL or hash Join
Response Time The core of user experience
Why? So Slow! Application Logic Tune at sql level
How to review sql Verifying Optimizer Statistics Reviewing the Execution Plan Restructuring the SQL Statements(code change) Restructuring the Indexes
SQLT: Nice tool review top sql Statistics:Tables/Indexes/Columns Execution plan Predication Bind value SQL profile
Table/Index stats Table stats Last_Analyzed Num_Rows Sample_Size Index stats Last_Analyzed Num_Rows Sample_Size DISTINCT_KEYS BLEVEL Clustering_Factor
Column statistics num_rows  num_distinct density num_nulls num_buckets histogram low_value high_value
How to gather Table/Column statistics Using auto method exec dbms_stats.gather_table_stats('CS2_PARTY_OWNER','CS2_BKG_RQST',method_opt=>' for all columns size auto', cascade=>true); For specific columns exec dbms_stats.gather_table_stats('CS2_PARTY_OWNER','CS2_BKG_RQST',method_opt=>' for columns size 254 SP_COMPANY_ID', cascade=>true);
Column Histogram
Review execution plan Driving table has the best filter Join method: Nested Loop or Hash Join Join order: Fewest number of rows are being returned to the next step Each table is being accessed efficiently index scan full table scan
Nested Loop For small number of rows(< 1000 ), with a good driving condition between the two tables
Hash Function
Hash Join   For large data set(> 1000 ): The optimizer uses the smaller of two tables or data sources to build a hash table on the join key in memory
Access Path Full Table Scans Index Scans Index Unique Scans Index Range Scans Full Scans Fast Full Index Scans Index Joins
SQL Profile SQL Profiles are the new feature from 10g which is managed by Oracle Enterprise Manager as part of the Automatic SQL Tuning process. Apart from OEM, SQL Profiles can be managed through the DBMS_SQLTUNE package.
normal usage of SQL Profile Run the SQL Tuning Advisor  Accept the recommended SQL Profile
advance usage: coe_xfr_sql_profile.sql coe_xfr_sql_profile.sql is from SQLT tool  An easy way to lock the sql plan as outline
 
Output sql format coe_xfr_sql_profile_<SID>_<PLAN_Hash_value>.SQL coe_xfr_sql_profile_chpub18xajb2w_1020905707.SQL
Q&A

More Related Content

What's hot

Ssis ssas sps_mdx_hong_bingli
Ssis ssas sps_mdx_hong_bingliSsis ssas sps_mdx_hong_bingli
Ssis ssas sps_mdx_hong_bingli
Hong-Bing Li
 
Walking down the memory lane with temporal tables
Walking down the memory lane with temporal tablesWalking down the memory lane with temporal tables
Walking down the memory lane with temporal tables
Argelo Royce Bautista
 
Ssis sql ssas_sps_mdx_hong_bingli
Ssis sql ssas_sps_mdx_hong_bingliSsis sql ssas_sps_mdx_hong_bingli
Ssis sql ssas_sps_mdx_hong_bingli
Hong-Bing Li
 
Ssis sql ssas_sps_mdx_hong_bingli
Ssis sql ssas_sps_mdx_hong_bingliSsis sql ssas_sps_mdx_hong_bingli
Ssis sql ssas_sps_mdx_hong_bingli
Hong-Bing Li
 
Ssis sql ssrs_sp_hb_li
Ssis sql ssrs_sp_hb_liSsis sql ssrs_sp_hb_li
Ssis sql ssrs_sp_hb_li
Hong-Bing Li
 
The Ultimate Guide to Oracle solaris 11 advanced system administration 1 z0 822
The Ultimate Guide to Oracle solaris 11 advanced system administration  1 z0 822The Ultimate Guide to Oracle solaris 11 advanced system administration  1 z0 822
The Ultimate Guide to Oracle solaris 11 advanced system administration 1 z0 822
SoniaSrivastva
 
Pnec 17 2
Pnec 17 2Pnec 17 2
Pnec 17 2
terribile
 
The Ultimate Guide to Oracle web logic server 12c administration i 1z0 133
 The Ultimate Guide to Oracle web logic server 12c  administration i  1z0 133 The Ultimate Guide to Oracle web logic server 12c  administration i  1z0 133
The Ultimate Guide to Oracle web logic server 12c administration i 1z0 133
SoniaSrivastva
 
Les03
Les03Les03
form view
form viewform view
form view
AbiMurugan2
 
Horizontal aggregatios in sql to prepare dataset using split-spj metho
Horizontal aggregatios in sql to prepare dataset using split-spj methoHorizontal aggregatios in sql to prepare dataset using split-spj metho
Horizontal aggregatios in sql to prepare dataset using split-spj metho
Arifur Rahman Sazal
 
Databind in asp.net
Databind in asp.netDatabind in asp.net
Databind in asp.net
Sireesh K
 
Generic Graph And Psets
Generic Graph And PsetsGeneric Graph And Psets
Generic Graph And Psets
manishekhar
 
Ssis sql ssrs_ssas_sp_mdx_hb_li
Ssis sql ssrs_ssas_sp_mdx_hb_liSsis sql ssrs_ssas_sp_mdx_hb_li
Ssis sql ssrs_ssas_sp_mdx_hb_li
Hong-Bing Li
 
Ssis ssas sps_mdx_hong_bingli
Ssis ssas sps_mdx_hong_bingliSsis ssas sps_mdx_hong_bingli
Ssis ssas sps_mdx_hong_bingli
Hong-Bing Li
 
Abap faq
Abap faqAbap faq
Abap faq
Kranthi Kumar
 
The Ultimate Guide to Oracle solaris 11 installation and configuration essent...
The Ultimate Guide to Oracle solaris 11 installation and configuration essent...The Ultimate Guide to Oracle solaris 11 installation and configuration essent...
The Ultimate Guide to Oracle solaris 11 installation and configuration essent...
SoniaSrivastva
 
Sql server lesson6
Sql server lesson6Sql server lesson6
Sql server lesson6
Ala Qunaibi
 
Edition Based Redefinition
Edition Based RedefinitionEdition Based Redefinition
Edition Based Redefinition
Alex Nuijten
 

What's hot (19)

Ssis ssas sps_mdx_hong_bingli
Ssis ssas sps_mdx_hong_bingliSsis ssas sps_mdx_hong_bingli
Ssis ssas sps_mdx_hong_bingli
 
Walking down the memory lane with temporal tables
Walking down the memory lane with temporal tablesWalking down the memory lane with temporal tables
Walking down the memory lane with temporal tables
 
Ssis sql ssas_sps_mdx_hong_bingli
Ssis sql ssas_sps_mdx_hong_bingliSsis sql ssas_sps_mdx_hong_bingli
Ssis sql ssas_sps_mdx_hong_bingli
 
Ssis sql ssas_sps_mdx_hong_bingli
Ssis sql ssas_sps_mdx_hong_bingliSsis sql ssas_sps_mdx_hong_bingli
Ssis sql ssas_sps_mdx_hong_bingli
 
Ssis sql ssrs_sp_hb_li
Ssis sql ssrs_sp_hb_liSsis sql ssrs_sp_hb_li
Ssis sql ssrs_sp_hb_li
 
The Ultimate Guide to Oracle solaris 11 advanced system administration 1 z0 822
The Ultimate Guide to Oracle solaris 11 advanced system administration  1 z0 822The Ultimate Guide to Oracle solaris 11 advanced system administration  1 z0 822
The Ultimate Guide to Oracle solaris 11 advanced system administration 1 z0 822
 
Pnec 17 2
Pnec 17 2Pnec 17 2
Pnec 17 2
 
The Ultimate Guide to Oracle web logic server 12c administration i 1z0 133
 The Ultimate Guide to Oracle web logic server 12c  administration i  1z0 133 The Ultimate Guide to Oracle web logic server 12c  administration i  1z0 133
The Ultimate Guide to Oracle web logic server 12c administration i 1z0 133
 
Les03
Les03Les03
Les03
 
form view
form viewform view
form view
 
Horizontal aggregatios in sql to prepare dataset using split-spj metho
Horizontal aggregatios in sql to prepare dataset using split-spj methoHorizontal aggregatios in sql to prepare dataset using split-spj metho
Horizontal aggregatios in sql to prepare dataset using split-spj metho
 
Databind in asp.net
Databind in asp.netDatabind in asp.net
Databind in asp.net
 
Generic Graph And Psets
Generic Graph And PsetsGeneric Graph And Psets
Generic Graph And Psets
 
Ssis sql ssrs_ssas_sp_mdx_hb_li
Ssis sql ssrs_ssas_sp_mdx_hb_liSsis sql ssrs_ssas_sp_mdx_hb_li
Ssis sql ssrs_ssas_sp_mdx_hb_li
 
Ssis ssas sps_mdx_hong_bingli
Ssis ssas sps_mdx_hong_bingliSsis ssas sps_mdx_hong_bingli
Ssis ssas sps_mdx_hong_bingli
 
Abap faq
Abap faqAbap faq
Abap faq
 
The Ultimate Guide to Oracle solaris 11 installation and configuration essent...
The Ultimate Guide to Oracle solaris 11 installation and configuration essent...The Ultimate Guide to Oracle solaris 11 installation and configuration essent...
The Ultimate Guide to Oracle solaris 11 installation and configuration essent...
 
Sql server lesson6
Sql server lesson6Sql server lesson6
Sql server lesson6
 
Edition Based Redefinition
Edition Based RedefinitionEdition Based Redefinition
Edition Based Redefinition
 

Viewers also liked

Oracle DB 12c SQL Tuning
Oracle DB 12c SQL TuningOracle DB 12c SQL Tuning
Oracle DB 12c SQL Tuning
OPITZ CONSULTING Deutschland
 
Consultas en MS SQL Server 2012
Consultas en MS SQL Server 2012Consultas en MS SQL Server 2012
Consultas en MS SQL Server 2012
CarlosFloresRoman
 
Joins SQL Server
Joins SQL ServerJoins SQL Server
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating ViewsMS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
sqlserver content
 
Using grouping sets in sql server 2008 tech republic
Using grouping sets in sql server 2008   tech republicUsing grouping sets in sql server 2008   tech republic
Using grouping sets in sql server 2008 tech republic
Kaing Menglieng
 
Sql db optimization
Sql db optimizationSql db optimization
Sql db optimization
Nikhildas P C
 
Sql xp 04
Sql xp 04Sql xp 04
Sql xp 04
Niit Care
 
Statistics
StatisticsStatistics
Statistics
Riteshkiit
 
e computer notes - Subqueries
e computer notes - Subqueriese computer notes - Subqueries
e computer notes - Subqueries
ecomputernotes
 
Sub-queries,Groupby and having in SQL
Sub-queries,Groupby and having in SQLSub-queries,Groupby and having in SQL
Sub-queries,Groupby and having in SQL
Vikash Sharma
 
Locking in SQL Server
Locking in SQL ServerLocking in SQL Server
Locking in SQL Server
Prashant Gogoi
 
Review of SQL
Review of SQLReview of SQL
Review of SQL
Information Technology
 
Triggers-Sequences-SQL
Triggers-Sequences-SQLTriggers-Sequences-SQL
Triggers-Sequences-SQL
Patrick Seery
 
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1 "Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
Andriy Krayniy
 
Lecture 4. MS SQL. DML Triggers
Lecture 4. MS SQL. DML TriggersLecture 4. MS SQL. DML Triggers
Lecture 4. MS SQL. DML Triggers
Alexey Furmanov
 
Sql query analyzer & maintenance
Sql query analyzer & maintenanceSql query analyzer & maintenance
Sql query analyzer & maintenance
nspyrenet
 
Locking And Concurrency
Locking And ConcurrencyLocking And Concurrency
Locking And Concurrency
sqlserver.co.il
 
SQL Server - Using Tools to Analyze Query Performance
SQL Server - Using Tools to Analyze Query PerformanceSQL Server - Using Tools to Analyze Query Performance
SQL Server - Using Tools to Analyze Query Performance
Marek Maśko
 
View, Store Procedure & Function and Trigger in MySQL - Thaipt
View, Store Procedure & Function and Trigger in MySQL - ThaiptView, Store Procedure & Function and Trigger in MySQL - Thaipt
View, Store Procedure & Function and Trigger in MySQL - Thaipt
Framgia Vietnam
 
SQL subquery
SQL subquerySQL subquery
SQL subquery
Vikas Gupta
 

Viewers also liked (20)

Oracle DB 12c SQL Tuning
Oracle DB 12c SQL TuningOracle DB 12c SQL Tuning
Oracle DB 12c SQL Tuning
 
Consultas en MS SQL Server 2012
Consultas en MS SQL Server 2012Consultas en MS SQL Server 2012
Consultas en MS SQL Server 2012
 
Joins SQL Server
Joins SQL ServerJoins SQL Server
Joins SQL Server
 
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating ViewsMS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
 
Using grouping sets in sql server 2008 tech republic
Using grouping sets in sql server 2008   tech republicUsing grouping sets in sql server 2008   tech republic
Using grouping sets in sql server 2008 tech republic
 
Sql db optimization
Sql db optimizationSql db optimization
Sql db optimization
 
Sql xp 04
Sql xp 04Sql xp 04
Sql xp 04
 
Statistics
StatisticsStatistics
Statistics
 
e computer notes - Subqueries
e computer notes - Subqueriese computer notes - Subqueries
e computer notes - Subqueries
 
Sub-queries,Groupby and having in SQL
Sub-queries,Groupby and having in SQLSub-queries,Groupby and having in SQL
Sub-queries,Groupby and having in SQL
 
Locking in SQL Server
Locking in SQL ServerLocking in SQL Server
Locking in SQL Server
 
Review of SQL
Review of SQLReview of SQL
Review of SQL
 
Triggers-Sequences-SQL
Triggers-Sequences-SQLTriggers-Sequences-SQL
Triggers-Sequences-SQL
 
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1 "Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
 
Lecture 4. MS SQL. DML Triggers
Lecture 4. MS SQL. DML TriggersLecture 4. MS SQL. DML Triggers
Lecture 4. MS SQL. DML Triggers
 
Sql query analyzer & maintenance
Sql query analyzer & maintenanceSql query analyzer & maintenance
Sql query analyzer & maintenance
 
Locking And Concurrency
Locking And ConcurrencyLocking And Concurrency
Locking And Concurrency
 
SQL Server - Using Tools to Analyze Query Performance
SQL Server - Using Tools to Analyze Query PerformanceSQL Server - Using Tools to Analyze Query Performance
SQL Server - Using Tools to Analyze Query Performance
 
View, Store Procedure & Function and Trigger in MySQL - Thaipt
View, Store Procedure & Function and Trigger in MySQL - ThaiptView, Store Procedure & Function and Trigger in MySQL - Thaipt
View, Store Procedure & Function and Trigger in MySQL - Thaipt
 
SQL subquery
SQL subquerySQL subquery
SQL subquery
 

Similar to Sql tuning guideline

SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
Dhananjay Goel
 
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
InSync Conference
 
05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx
KareemBullard1
 
Novidades do SQL Server 2016
Novidades do SQL Server 2016Novidades do SQL Server 2016
Novidades do SQL Server 2016
Marcos Freccia
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007
paulguerin
 
Whats New on SAP HANA SPS 11 Core Database Capabilities
Whats New on SAP HANA SPS 11 Core Database CapabilitiesWhats New on SAP HANA SPS 11 Core Database Capabilities
Whats New on SAP HANA SPS 11 Core Database Capabilities
SAP Technology
 
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
Jürgen Ambrosi
 
Query parameterization
Query parameterizationQuery parameterization
Query parameterization
Riteshkiit
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
rainynovember12
 
TSQL in SQL Server 2012
TSQL in SQL Server 2012TSQL in SQL Server 2012
TSQL in SQL Server 2012
Eduardo Castro
 
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
InSync Conference
 
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginnersSQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
Tobias Koprowski
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
MSDEVMTL
 
Sq lite
Sq liteSq lite
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
Edgar Alejandro Villegas
 
Sql 2016 - What's New
Sql 2016 - What's NewSql 2016 - What's New
Sql 2016 - What's New
dpcobb
 
Web Cloud Computing SQL Server - Ferrara University
Web Cloud Computing SQL Server  -  Ferrara UniversityWeb Cloud Computing SQL Server  -  Ferrara University
Web Cloud Computing SQL Server - Ferrara University
antimo musone
 
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
Carlos Oliveira
 
Unit 3
Unit 3Unit 3
Unit 3
Abha Damani
 
Oracle Query Optimizer - An Introduction
Oracle Query Optimizer - An IntroductionOracle Query Optimizer - An Introduction
Oracle Query Optimizer - An Introduction
adryanbub
 

Similar to Sql tuning guideline (20)

SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
 
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
 
05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx
 
Novidades do SQL Server 2016
Novidades do SQL Server 2016Novidades do SQL Server 2016
Novidades do SQL Server 2016
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007
 
Whats New on SAP HANA SPS 11 Core Database Capabilities
Whats New on SAP HANA SPS 11 Core Database CapabilitiesWhats New on SAP HANA SPS 11 Core Database Capabilities
Whats New on SAP HANA SPS 11 Core Database Capabilities
 
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
 
Query parameterization
Query parameterizationQuery parameterization
Query parameterization
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
 
TSQL in SQL Server 2012
TSQL in SQL Server 2012TSQL in SQL Server 2012
TSQL in SQL Server 2012
 
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
 
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginnersSQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
 
Sq lite
Sq liteSq lite
Sq lite
 
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
 
Sql 2016 - What's New
Sql 2016 - What's NewSql 2016 - What's New
Sql 2016 - What's New
 
Web Cloud Computing SQL Server - Ferrara University
Web Cloud Computing SQL Server  -  Ferrara UniversityWeb Cloud Computing SQL Server  -  Ferrara University
Web Cloud Computing SQL Server - Ferrara University
 
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
 
Unit 3
Unit 3Unit 3
Unit 3
 
Oracle Query Optimizer - An Introduction
Oracle Query Optimizer - An IntroductionOracle Query Optimizer - An Introduction
Oracle Query Optimizer - An Introduction
 

Recently uploaded

FIDO Munich Seminar: Biometrics and Passkeys for In-Vehicle Apps.pptx
FIDO Munich Seminar: Biometrics and Passkeys for In-Vehicle Apps.pptxFIDO Munich Seminar: Biometrics and Passkeys for In-Vehicle Apps.pptx
FIDO Munich Seminar: Biometrics and Passkeys for In-Vehicle Apps.pptx
FIDO Alliance
 
How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...
DianaGray10
 
Cracking AI Black Box - Strategies for Customer-centric Enterprise Excellence
Cracking AI Black Box - Strategies for Customer-centric Enterprise ExcellenceCracking AI Black Box - Strategies for Customer-centric Enterprise Excellence
Cracking AI Black Box - Strategies for Customer-centric Enterprise Excellence
Quentin Reul
 
Mastering Board Best Practices: Essential Skills for Effective Non-profit Lea...
Mastering Board Best Practices: Essential Skills for Effective Non-profit Lea...Mastering Board Best Practices: Essential Skills for Effective Non-profit Lea...
Mastering Board Best Practices: Essential Skills for Effective Non-profit Lea...
OnBoard
 
FIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Munich Seminar FIDO Automotive Apps.pptxFIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Alliance
 
The Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - CoatueThe Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - Coatue
Razin Mustafiz
 
Perth MuleSoft Meetup July 2024
Perth MuleSoft Meetup July 2024Perth MuleSoft Meetup July 2024
Perth MuleSoft Meetup July 2024
Michael Price
 
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Zilliz
 
Zaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdfZaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdf
AmandaCheung15
 
TrustArc Webinar - Innovating with TRUSTe Responsible AI Certification
TrustArc Webinar - Innovating with TRUSTe Responsible AI CertificationTrustArc Webinar - Innovating with TRUSTe Responsible AI Certification
TrustArc Webinar - Innovating with TRUSTe Responsible AI Certification
TrustArc
 
It's your unstructured data: How to get your GenAI app to production (and spe...
It's your unstructured data: How to get your GenAI app to production (and spe...It's your unstructured data: How to get your GenAI app to production (and spe...
It's your unstructured data: How to get your GenAI app to production (and spe...
Zilliz
 
Enterprise_Mobile_Security_Forum_2013.pdf
Enterprise_Mobile_Security_Forum_2013.pdfEnterprise_Mobile_Security_Forum_2013.pdf
Enterprise_Mobile_Security_Forum_2013.pdf
Yury Chemerkin
 
Self-Healing Test Automation Framework - Healenium
Self-Healing Test Automation Framework - HealeniumSelf-Healing Test Automation Framework - Healenium
Self-Healing Test Automation Framework - Healenium
Knoldus Inc.
 
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan..."Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...
Fwdays
 
FIDO Munich Seminar Introduction to FIDO.pptx
FIDO Munich Seminar Introduction to FIDO.pptxFIDO Munich Seminar Introduction to FIDO.pptx
FIDO Munich Seminar Introduction to FIDO.pptx
FIDO Alliance
 
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...
Snarky Security
 
Retrieval Augmented Generation Evaluation with Ragas
Retrieval Augmented Generation Evaluation with RagasRetrieval Augmented Generation Evaluation with Ragas
Retrieval Augmented Generation Evaluation with Ragas
Zilliz
 
AMD Zen 5 Architecture Deep Dive from Tech Day
AMD Zen 5 Architecture Deep Dive from Tech DayAMD Zen 5 Architecture Deep Dive from Tech Day
AMD Zen 5 Architecture Deep Dive from Tech Day
Low Hong Chuan
 
Indian Privacy law & Infosec for Startups
Indian Privacy law & Infosec for StartupsIndian Privacy law & Infosec for Startups
Indian Privacy law & Infosec for Startups
AMol NAik
 
DefCamp_2016_Chemerkin_Yury_--_publish.pdf
DefCamp_2016_Chemerkin_Yury_--_publish.pdfDefCamp_2016_Chemerkin_Yury_--_publish.pdf
DefCamp_2016_Chemerkin_Yury_--_publish.pdf
Yury Chemerkin
 

Recently uploaded (20)

FIDO Munich Seminar: Biometrics and Passkeys for In-Vehicle Apps.pptx
FIDO Munich Seminar: Biometrics and Passkeys for In-Vehicle Apps.pptxFIDO Munich Seminar: Biometrics and Passkeys for In-Vehicle Apps.pptx
FIDO Munich Seminar: Biometrics and Passkeys for In-Vehicle Apps.pptx
 
How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...
 
Cracking AI Black Box - Strategies for Customer-centric Enterprise Excellence
Cracking AI Black Box - Strategies for Customer-centric Enterprise ExcellenceCracking AI Black Box - Strategies for Customer-centric Enterprise Excellence
Cracking AI Black Box - Strategies for Customer-centric Enterprise Excellence
 
Mastering Board Best Practices: Essential Skills for Effective Non-profit Lea...
Mastering Board Best Practices: Essential Skills for Effective Non-profit Lea...Mastering Board Best Practices: Essential Skills for Effective Non-profit Lea...
Mastering Board Best Practices: Essential Skills for Effective Non-profit Lea...
 
FIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Munich Seminar FIDO Automotive Apps.pptxFIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Munich Seminar FIDO Automotive Apps.pptx
 
The Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - CoatueThe Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - Coatue
 
Perth MuleSoft Meetup July 2024
Perth MuleSoft Meetup July 2024Perth MuleSoft Meetup July 2024
Perth MuleSoft Meetup July 2024
 
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
 
Zaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdfZaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdf
 
TrustArc Webinar - Innovating with TRUSTe Responsible AI Certification
TrustArc Webinar - Innovating with TRUSTe Responsible AI CertificationTrustArc Webinar - Innovating with TRUSTe Responsible AI Certification
TrustArc Webinar - Innovating with TRUSTe Responsible AI Certification
 
It's your unstructured data: How to get your GenAI app to production (and spe...
It's your unstructured data: How to get your GenAI app to production (and spe...It's your unstructured data: How to get your GenAI app to production (and spe...
It's your unstructured data: How to get your GenAI app to production (and spe...
 
Enterprise_Mobile_Security_Forum_2013.pdf
Enterprise_Mobile_Security_Forum_2013.pdfEnterprise_Mobile_Security_Forum_2013.pdf
Enterprise_Mobile_Security_Forum_2013.pdf
 
Self-Healing Test Automation Framework - Healenium
Self-Healing Test Automation Framework - HealeniumSelf-Healing Test Automation Framework - Healenium
Self-Healing Test Automation Framework - Healenium
 
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan..."Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...
 
FIDO Munich Seminar Introduction to FIDO.pptx
FIDO Munich Seminar Introduction to FIDO.pptxFIDO Munich Seminar Introduction to FIDO.pptx
FIDO Munich Seminar Introduction to FIDO.pptx
 
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...
 
Retrieval Augmented Generation Evaluation with Ragas
Retrieval Augmented Generation Evaluation with RagasRetrieval Augmented Generation Evaluation with Ragas
Retrieval Augmented Generation Evaluation with Ragas
 
AMD Zen 5 Architecture Deep Dive from Tech Day
AMD Zen 5 Architecture Deep Dive from Tech DayAMD Zen 5 Architecture Deep Dive from Tech Day
AMD Zen 5 Architecture Deep Dive from Tech Day
 
Indian Privacy law & Infosec for Startups
Indian Privacy law & Infosec for StartupsIndian Privacy law & Infosec for Startups
Indian Privacy law & Infosec for Startups
 
DefCamp_2016_Chemerkin_Yury_--_publish.pdf
DefCamp_2016_Chemerkin_Yury_--_publish.pdfDefCamp_2016_Chemerkin_Yury_--_publish.pdf
DefCamp_2016_Chemerkin_Yury_--_publish.pdf
 

Sql tuning guideline

  • 1. SQL Tuning Guideline Sidney · 2011 Feb 16
  • 2. Agenda The Guideline to tune sql Application Logic Table/Column statistics SQL access path SQL join NL or hash Join
  • 3. Response Time The core of user experience
  • 4. Why? So Slow! Application Logic Tune at sql level
  • 5. How to review sql Verifying Optimizer Statistics Reviewing the Execution Plan Restructuring the SQL Statements(code change) Restructuring the Indexes
  • 6. SQLT: Nice tool review top sql Statistics:Tables/Indexes/Columns Execution plan Predication Bind value SQL profile
  • 7. Table/Index stats Table stats Last_Analyzed Num_Rows Sample_Size Index stats Last_Analyzed Num_Rows Sample_Size DISTINCT_KEYS BLEVEL Clustering_Factor
  • 8. Column statistics num_rows num_distinct density num_nulls num_buckets histogram low_value high_value
  • 9. How to gather Table/Column statistics Using auto method exec dbms_stats.gather_table_stats('CS2_PARTY_OWNER','CS2_BKG_RQST',method_opt=>' for all columns size auto', cascade=>true); For specific columns exec dbms_stats.gather_table_stats('CS2_PARTY_OWNER','CS2_BKG_RQST',method_opt=>' for columns size 254 SP_COMPANY_ID', cascade=>true);
  • 11. Review execution plan Driving table has the best filter Join method: Nested Loop or Hash Join Join order: Fewest number of rows are being returned to the next step Each table is being accessed efficiently index scan full table scan
  • 12. Nested Loop For small number of rows(< 1000 ), with a good driving condition between the two tables
  • 14. Hash Join For large data set(> 1000 ): The optimizer uses the smaller of two tables or data sources to build a hash table on the join key in memory
  • 15. Access Path Full Table Scans Index Scans Index Unique Scans Index Range Scans Full Scans Fast Full Index Scans Index Joins
  • 16. SQL Profile SQL Profiles are the new feature from 10g which is managed by Oracle Enterprise Manager as part of the Automatic SQL Tuning process. Apart from OEM, SQL Profiles can be managed through the DBMS_SQLTUNE package.
  • 17. normal usage of SQL Profile Run the SQL Tuning Advisor Accept the recommended SQL Profile
  • 18. advance usage: coe_xfr_sql_profile.sql coe_xfr_sql_profile.sql is from SQLT tool An easy way to lock the sql plan as outline
  • 19.  
  • 20. Output sql format coe_xfr_sql_profile_<SID>_<PLAN_Hash_value>.SQL coe_xfr_sql_profile_chpub18xajb2w_1020905707.SQL
  • 21. Q&A