Submit Search
Upload
How to analyze and tune sql queries for better performance webinar
ā¢
17 likes
ā¢
4,261 views
O
oysteing
Follow
MySQL Webinar, Feb 25, 2015
Read less
Read more
Software
Report
Share
Report
Share
1 of 58
Download now
Download to read offline
Recommended
How to analyze and tune sql queries for better performance vts2016
How to analyze and tune sql queries for better performance vts2016
oysteing
Ā
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performance
oysteing
Ā
How to analyze and tune sql queries for better performance percona15
How to analyze and tune sql queries for better performance percona15
oysteing
Ā
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performance
oysteing
Ā
MySQL Optimizer Cost Model
MySQL Optimizer Cost Model
Olav SandstƄ
Ā
MySQL 8.0: Common Table Expressions
MySQL 8.0: Common Table Expressions
oysteing
Ā
MySQL Optimizer Overview
MySQL Optimizer Overview
Olav SandstƄ
Ā
How to analyze and tune sql queries for better performance
How to analyze and tune sql queries for better performance
oysteing
Ā
Recommended
How to analyze and tune sql queries for better performance vts2016
How to analyze and tune sql queries for better performance vts2016
oysteing
Ā
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performance
oysteing
Ā
How to analyze and tune sql queries for better performance percona15
How to analyze and tune sql queries for better performance percona15
oysteing
Ā
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performance
oysteing
Ā
MySQL Optimizer Cost Model
MySQL Optimizer Cost Model
Olav SandstƄ
Ā
MySQL 8.0: Common Table Expressions
MySQL 8.0: Common Table Expressions
oysteing
Ā
MySQL Optimizer Overview
MySQL Optimizer Overview
Olav SandstƄ
Ā
How to analyze and tune sql queries for better performance
How to analyze and tune sql queries for better performance
oysteing
Ā
Optimizing MySQL Queries
Optimizing MySQL Queries
Achievers Tech
Ā
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Jaime Crespo
Ā
MySQL Optimizer Overview
MySQL Optimizer Overview
Olav SandstƄ
Ā
MySQL Optimizer Overview
MySQL Optimizer Overview
MYXPLAIN
Ā
MySQL 8.0: Common Table Expressions
MySQL 8.0: Common Table Expressions
oysteing
Ā
Explain that explain
Explain that explain
Fabrizio Parrella
Ā
Optimizer overviewoow2014
Optimizer overviewoow2014
Mysql User Camp
Ā
MySQL: Indexing for Better Performance
MySQL: Indexing for Better Performance
jkeriaki
Ā
MySQL Query And Index Tuning
MySQL Query And Index Tuning
Manikanda kumar
Ā
MySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZE
MySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZE
Norvald Ryeng
Ā
MySQL Performance Tips & Best Practices
MySQL Performance Tips & Best Practices
Isaac Mosquera
Ā
How mysql choose the execution plan
How mysql choose the execution plan
č¾é¹¤ ę
Ā
The Query Rewrite Plugin Interface: Writing Your Own Plugin
The Query Rewrite Plugin Interface: Writing Your Own Plugin
MartinHanssonOracle
Ā
Oracle Course
Oracle Course
rspaike
Ā
Indexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuning
OSSCube
Ā
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
Nirav Shah
Ā
Oracle 12c SPM
Oracle 12c SPM
Anton Bushmelev
Ā
Explain the explain_plan
Explain the explain_plan
Maria Colgan
Ā
MySQL Performance Schema in Action: the Complete Tutorial
MySQL Performance Schema in Action: the Complete Tutorial
Sveta Smirnova
Ā
MySQL index optimization techniques
MySQL index optimization techniques
kumar gaurav
Ā
Using Optimizer Hints to Improve MySQL Query Performance
Using Optimizer Hints to Improve MySQL Query Performance
oysteing
Ā
MySQL 8.0: GIS ā Are you ready?
MySQL 8.0: GIS ā Are you ready?
Norvald Ryeng
Ā
More Related Content
What's hot
Optimizing MySQL Queries
Optimizing MySQL Queries
Achievers Tech
Ā
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Jaime Crespo
Ā
MySQL Optimizer Overview
MySQL Optimizer Overview
Olav SandstƄ
Ā
MySQL Optimizer Overview
MySQL Optimizer Overview
MYXPLAIN
Ā
MySQL 8.0: Common Table Expressions
MySQL 8.0: Common Table Expressions
oysteing
Ā
Explain that explain
Explain that explain
Fabrizio Parrella
Ā
Optimizer overviewoow2014
Optimizer overviewoow2014
Mysql User Camp
Ā
MySQL: Indexing for Better Performance
MySQL: Indexing for Better Performance
jkeriaki
Ā
MySQL Query And Index Tuning
MySQL Query And Index Tuning
Manikanda kumar
Ā
MySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZE
MySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZE
Norvald Ryeng
Ā
MySQL Performance Tips & Best Practices
MySQL Performance Tips & Best Practices
Isaac Mosquera
Ā
How mysql choose the execution plan
How mysql choose the execution plan
č¾é¹¤ ę
Ā
The Query Rewrite Plugin Interface: Writing Your Own Plugin
The Query Rewrite Plugin Interface: Writing Your Own Plugin
MartinHanssonOracle
Ā
Oracle Course
Oracle Course
rspaike
Ā
Indexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuning
OSSCube
Ā
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
Nirav Shah
Ā
Oracle 12c SPM
Oracle 12c SPM
Anton Bushmelev
Ā
Explain the explain_plan
Explain the explain_plan
Maria Colgan
Ā
MySQL Performance Schema in Action: the Complete Tutorial
MySQL Performance Schema in Action: the Complete Tutorial
Sveta Smirnova
Ā
MySQL index optimization techniques
MySQL index optimization techniques
kumar gaurav
Ā
What's hot
(20)
Optimizing MySQL Queries
Optimizing MySQL Queries
Ā
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Ā
MySQL Optimizer Overview
MySQL Optimizer Overview
Ā
MySQL Optimizer Overview
MySQL Optimizer Overview
Ā
MySQL 8.0: Common Table Expressions
MySQL 8.0: Common Table Expressions
Ā
Explain that explain
Explain that explain
Ā
Optimizer overviewoow2014
Optimizer overviewoow2014
Ā
MySQL: Indexing for Better Performance
MySQL: Indexing for Better Performance
Ā
MySQL Query And Index Tuning
MySQL Query And Index Tuning
Ā
MySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZE
MySQL 8.0.18 latest updates: Hash join and EXPLAIN ANALYZE
Ā
MySQL Performance Tips & Best Practices
MySQL Performance Tips & Best Practices
Ā
How mysql choose the execution plan
How mysql choose the execution plan
Ā
The Query Rewrite Plugin Interface: Writing Your Own Plugin
The Query Rewrite Plugin Interface: Writing Your Own Plugin
Ā
Oracle Course
Oracle Course
Ā
Indexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuning
Ā
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
Ā
Oracle 12c SPM
Oracle 12c SPM
Ā
Explain the explain_plan
Explain the explain_plan
Ā
MySQL Performance Schema in Action: the Complete Tutorial
MySQL Performance Schema in Action: the Complete Tutorial
Ā
MySQL index optimization techniques
MySQL index optimization techniques
Ā
Viewers also liked
Using Optimizer Hints to Improve MySQL Query Performance
Using Optimizer Hints to Improve MySQL Query Performance
oysteing
Ā
MySQL 8.0: GIS ā Are you ready?
MySQL 8.0: GIS ā Are you ready?
Norvald Ryeng
Ā
Polyglot Database - Linuxcon North America 2016
Polyglot Database - Linuxcon North America 2016
Dave Stokes
Ā
MySQL EXPLAIN Explained-Norvald H. Ryeng
MySQL EXPLAIN Explained-Norvald H. Ryeng
éč ē
Ā
What Your Database Query is Really Doing
What Your Database Query is Really Doing
Dave Stokes
Ā
MySQL Schema Design in Practice
MySQL Schema Design in Practice
Jaime Crespo
Ā
SQL window functions for MySQL
SQL window functions for MySQL
Dag H. Wanvik
Ā
My sql explain cheat sheet
My sql explain cheat sheet
Achievers Tech
Ā
MySQL Server Defaults
MySQL Server Defaults
Morgan Tocker
Ā
What you wanted to know about MySQL, but could not find using inernal instrum...
What you wanted to know about MySQL, but could not find using inernal instrum...
Sveta Smirnova
Ā
How Booking.com avoids and deals with replication lag
How Booking.com avoids and deals with replication lag
Jean-FranƧois GagnƩ
Ā
Visual Design with Data
Visual Design with Data
Seth Familian
Ā
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
Drift
Ā
Percona Live London 2014: Serve out any page with an HA Sphinx environment
Percona Live London 2014: Serve out any page with an HA Sphinx environment
spil-engineering
Ā
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Leslie Samuel
Ā
Docker on Windows
Docker on Windows
Carl Su
Ā
Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)
Sauce Labs
Ā
MySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
Mark Leith
Ā
Viewers also liked
(18)
Using Optimizer Hints to Improve MySQL Query Performance
Using Optimizer Hints to Improve MySQL Query Performance
Ā
MySQL 8.0: GIS ā Are you ready?
MySQL 8.0: GIS ā Are you ready?
Ā
Polyglot Database - Linuxcon North America 2016
Polyglot Database - Linuxcon North America 2016
Ā
MySQL EXPLAIN Explained-Norvald H. Ryeng
MySQL EXPLAIN Explained-Norvald H. Ryeng
Ā
What Your Database Query is Really Doing
What Your Database Query is Really Doing
Ā
MySQL Schema Design in Practice
MySQL Schema Design in Practice
Ā
SQL window functions for MySQL
SQL window functions for MySQL
Ā
My sql explain cheat sheet
My sql explain cheat sheet
Ā
MySQL Server Defaults
MySQL Server Defaults
Ā
What you wanted to know about MySQL, but could not find using inernal instrum...
What you wanted to know about MySQL, but could not find using inernal instrum...
Ā
How Booking.com avoids and deals with replication lag
How Booking.com avoids and deals with replication lag
Ā
Visual Design with Data
Visual Design with Data
Ā
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
Ā
Percona Live London 2014: Serve out any page with an HA Sphinx environment
Percona Live London 2014: Serve out any page with an HA Sphinx environment
Ā
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Ā
Docker on Windows
Docker on Windows
Ā
Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)
Ā
MySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
Ā
Similar to How to analyze and tune sql queries for better performance webinar
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performance
oysteing
Ā
Histogram Support in MySQL 8.0
Histogram Support in MySQL 8.0
oysteing
Ā
MySQL Performance Optimization
MySQL Performance Optimization
Mindfire Solutions
Ā
Mysql Performance Schema - fossasia 2016
Mysql Performance Schema - fossasia 2016
Mayank Prasad
Ā
MySQL Performance Schema : fossasia
MySQL Performance Schema : fossasia
Mayank Prasad
Ā
SQL Tunning
SQL Tunning
Dhananjay Goel
Ā
Processes in Query Optimization in (ABMS) Advanced Database Management Systems
Processes in Query Optimization in (ABMS) Advanced Database Management Systems
gamemaker762
Ā
Indexes overview
Indexes overview
aioughydchapter
Ā
Best Practices for Oracle Exadata and the Oracle Optimizer
Best Practices for Oracle Exadata and the Oracle Optimizer
Edgar Alejandro Villegas
Ā
PresentaciĆ³n Oracle Database MigraciĆ³n consideraciones 10g/11g/12c
PresentaciĆ³n Oracle Database MigraciĆ³n consideraciones 10g/11g/12c
Ronald Francisco Vargas Quesada
Ā
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
Carlos Oliveira
Ā
Beginners guide to_optimizer
Beginners guide to_optimizer
Maria Colgan
Ā
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7
Morgan Tocker
Ā
MySQL Optimizer: What's New in 8.0
MySQL Optimizer: What's New in 8.0
Manyi Lu
Ā
Web Cloud Computing SQL Server - Ferrara University
Web Cloud Computing SQL Server - Ferrara University
antimo musone
Ā
MySQL Performance Schema, Open Source India, 2015
MySQL Performance Schema, Open Source India, 2015
Mayank Prasad
Ā
MySQL Troubleshooting with the Performance Schema
MySQL Troubleshooting with the Performance Schema
Sveta Smirnova
Ā
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
Mayank Prasad
Ā
How to Take Advantage of Optimizer Improvements in MySQL 8.0
How to Take Advantage of Optimizer Improvements in MySQL 8.0
Norvald Ryeng
Ā
ģ 3ķėź³µė¶ė½ ģ¤ķģģ¤ ģøķė¼ģøėÆøė - MySQL Performance
ģ 3ķėź³µė¶ė½ ģ¤ķģģ¤ ģøķė¼ģøėÆøė - MySQL Performance
Tommy Lee
Ā
Similar to How to analyze and tune sql queries for better performance webinar
(20)
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performance
Ā
Histogram Support in MySQL 8.0
Histogram Support in MySQL 8.0
Ā
MySQL Performance Optimization
MySQL Performance Optimization
Ā
Mysql Performance Schema - fossasia 2016
Mysql Performance Schema - fossasia 2016
Ā
MySQL Performance Schema : fossasia
MySQL Performance Schema : fossasia
Ā
SQL Tunning
SQL Tunning
Ā
Processes in Query Optimization in (ABMS) Advanced Database Management Systems
Processes in Query Optimization in (ABMS) Advanced Database Management Systems
Ā
Indexes overview
Indexes overview
Ā
Best Practices for Oracle Exadata and the Oracle Optimizer
Best Practices for Oracle Exadata and the Oracle Optimizer
Ā
PresentaciĆ³n Oracle Database MigraciĆ³n consideraciones 10g/11g/12c
PresentaciĆ³n Oracle Database MigraciĆ³n consideraciones 10g/11g/12c
Ā
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
Ā
Beginners guide to_optimizer
Beginners guide to_optimizer
Ā
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7
Ā
MySQL Optimizer: What's New in 8.0
MySQL Optimizer: What's New in 8.0
Ā
Web Cloud Computing SQL Server - Ferrara University
Web Cloud Computing SQL Server - Ferrara University
Ā
MySQL Performance Schema, Open Source India, 2015
MySQL Performance Schema, Open Source India, 2015
Ā
MySQL Troubleshooting with the Performance Schema
MySQL Troubleshooting with the Performance Schema
Ā
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
Ā
How to Take Advantage of Optimizer Improvements in MySQL 8.0
How to Take Advantage of Optimizer Improvements in MySQL 8.0
Ā
ģ 3ķėź³µė¶ė½ ģ¤ķģģ¤ ģøķė¼ģøėÆøė - MySQL Performance
ģ 3ķėź³µė¶ė½ ģ¤ķģģ¤ ģøķė¼ģøėÆøė - MySQL Performance
Ā
More from oysteing
POLARDB: A database architecture for the cloud
POLARDB: A database architecture for the cloud
oysteing
Ā
The MySQL Query Optimizer Explained Through Optimizer Trace
The MySQL Query Optimizer Explained Through Optimizer Trace
oysteing
Ā
POLARDB: A database architecture for the cloud
POLARDB: A database architecture for the cloud
oysteing
Ā
POLARDB for MySQL - Parallel Query
POLARDB for MySQL - Parallel Query
oysteing
Ā
JSON_TABLE -- The best of both worlds
JSON_TABLE -- The best of both worlds
oysteing
Ā
MySQL Optimizer: Whatās New in 8.0
MySQL Optimizer: Whatās New in 8.0
oysteing
Ā
Common Table Expressions (CTE) & Window Functions in MySQL 8.0
Common Table Expressions (CTE) & Window Functions in MySQL 8.0
oysteing
Ā
More from oysteing
(7)
POLARDB: A database architecture for the cloud
POLARDB: A database architecture for the cloud
Ā
The MySQL Query Optimizer Explained Through Optimizer Trace
The MySQL Query Optimizer Explained Through Optimizer Trace
Ā
POLARDB: A database architecture for the cloud
POLARDB: A database architecture for the cloud
Ā
POLARDB for MySQL - Parallel Query
POLARDB for MySQL - Parallel Query
Ā
JSON_TABLE -- The best of both worlds
JSON_TABLE -- The best of both worlds
Ā
MySQL Optimizer: Whatās New in 8.0
MySQL Optimizer: Whatās New in 8.0
Ā
Common Table Expressions (CTE) & Window Functions in MySQL 8.0
Common Table Expressions (CTE) & Window Functions in MySQL 8.0
Ā
Recently uploaded
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
Juha-Pekka Tolvanen
Ā
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
WSO2
Ā
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
Ā
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
Ā
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
Ā
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
Presentation.STUDIO
Ā
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
Ā
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2
Ā
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
Shane Coughlan
Ā
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
masabamasaba
Ā
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
WSO2
Ā
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
masabamasaba
Ā
Abortion Pill Prices Tembisa [(+27832195400*)] š„ Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] š„ Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
Ā
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
Ā
Abortion Pills In Pretoria ](+27832195400*)[ š„ Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ š„ Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
Ā
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
masabamasaba
Ā
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2
Ā
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
masabamasaba
Ā
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
WSO2
Ā
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
Ā
Recently uploaded
(20)
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
Ā
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
Ā
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
Ā
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
Ā
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
Ā
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
Ā
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Ā
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
Ā
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
Ā
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
Ā
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
Ā
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
Ā
Abortion Pill Prices Tembisa [(+27832195400*)] š„ Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] š„ Women's Abortion Clinic in T...
Ā
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
Ā
Abortion Pills In Pretoria ](+27832195400*)[ š„ Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ š„ Women's Abortion Clinic In Pre...
Ā
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
Ā
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
Ā
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
Ā
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
Ā
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Ā
How to analyze and tune sql queries for better performance webinar
1.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Ćystein GrĆøvlen Senior Principal Software Engineer MySQL Optimizer Team, Oracle February 25, 2015 How to Analyze and Tune MySQL Queries for Better Performance
2.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Program Agenda Introduction to MySQL cost-based optimizer Selecting data access method Join optimizer Sorting Tools for monitoring, analyzing, and tuning queries Influencing the Optimizer 1 2 3 4 5 6
3.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Program Agenda Introduction to MySQL optimizer Selecting data access method Join optimizer Sorting Tools for monitoring, analyzing, and tuning queries Influencing the Optimizer 1 2 3 4 5 6
4.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. MySQL Optimizer SELECT a, b FROM t1, t2, t3 WHERE t1.a = t2.b AND t2.b = t3.c AND t2.d > 20 AND t2.d < 30; MySQL Server Cost based optimizations Heuristics Cost Model Optimizer Table/index info (data dictionary) Statistics (storage engine) t2 t3 t1 Table scan Range scan Ref access JOIN JOIN
5.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Cost-based Query Optimization ā¢ Assign cost to operations ā¢ Computes cost of partial or alternative plans ā¢ Search for plan with lowest cost ā¢ Cost-based optimizations: General idea Access method Subquery strategyJoin order t2 t3 t1 Table scan Range scan Ref access JOIN JOIN
6.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. ā¢ IO-cost: ā Estimates from storage engine based on number of pages to read ā Both index and data pages ā¢ Schema: ā Length of records and keys ā Uniqueness for indexes ā Nullability ā¢ Statistics: ā Number of rows in table ā Key distribution/Cardinality: ā¢ Average number of records per key value ā¢ Only for indexed columns ā¢ Maintained by storage engine ā Number of records in an index range Input to Cost Model
7.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Cost Model Example Table scan: ā¢ IO-cost: #pages in table ā¢ CPU cost: #rows * ROW_EVALUATE_COST Range scan (on secondary index): ā¢ IO-cost: #pages to read from index + #rows_in_range ā¢ CPU cost: #rows_in_range * ROW_EVALUATE_COST SELECT SUM(o_totalprice) FROM orders WHERE o_orderdate BETWEEN '1994-01-01' AND '1994-12-31';
8.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Cost Model EXPLAIN SELECT SUM(o_totalprice) FROM orders WHERE o_orderdate BETWEEN '1994-01-01' AND '1994-12-31'; Example EXPLAIN SELECT SUM(o_totalprice) FROM orders WHERE o_orderdate BETWEEN '1994-01-01' AND '1994-06-30'; id select type table type possible keys key key len ref rows extra 1 SIMPLE orders ALL i_o_orderdate NULL NULL NULL 15000000 Using where Id select type table type possible keys key key len ref rows extra 1 SIMPLE orders range i_o_orderdate i_o_orderdate 4 NULL 2235118 Using index condition
9.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Cost Model Example: Optimizer Trace join_optimization / row_estimation / table : orders / range_analysis "table_scan": { "rows": 15000000, "cost": 3.12e6 } /* table_scan */, "potential_range_indices": [ { "index": "PRIMARY", "usable": false, "cause": "not_applicableā }, { "index": "i_o_orderdate", "usable": true, "key_parts": [ "o_orderDATE", "o_orderkey" ] } ] /* potential_range_indices */, ā¦ "analyzing_range_alternatives": { "range_scan_alternatives": [ { "index": "i_o_orderdate", "ranges": [ "1994-01-01 <= o_orderDATE <= 1994-12-31" ], "index_dives_for_eq_ranges": true, "rowid_ordered": false, "using_mrr": false, "index_only": false, "rows": 4489990, "cost": 5.39e6, "chosen": false, "cause": "cost" } ] /* range_scan_alternatives */, ā¦ } /* analyzing_range_alternatives */
10.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Cost Model vs Real World Data in Memory Data on Disk Data on SSD Table scan 6.8 seconds 36 seconds 15 seconds Index scan 5.2 seconds 2.5 hours 30 minutes Measured Execution Times Force Index Scan: SELECT SUM(o_totalprice) FROM orders FORCE INDEX (i_o_orderdate) WHERE o_orderdate BETWEEN '1994-01-01' AND '1994-12-31ā;
11.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Performance Schema SELECT event_name, count_read, avg_timer_read/1000000000.0 āAvg Read Time (ms)ā, sum_number_of_bytes_read āBytes Readā FROM performance_schema.file_summary_by_event_name WHERE event_name='wait/io/file/innodb/innodb_data_file'; Disk I/O event_name count_read Avg Read Time (ms) Bytes Read wait/io/file/innodb/innodb_data_file 2188853 4.2094 35862167552 event_name count_read Avg Read Time (ms) Bytes Read wait/io/file/innodb/innodb_data_file 115769 0.0342 1896759296 Index Scan Table Scan
12.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Program Agenda Introduction to MySQL optimizer Selecting data access method Join optimizer Sorting Tools for monitoring, analyzing, and tuning queries Influencing the Optimizer 1 2 3 4 5 6
13.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Selecting Access Method ā¢ For each table, find the best access method: ā Check if the access method is useful ā Estimate cost of using access method ā Select the cheapest to be used ā¢ Choice of access method is cost based Finding the optimal method to read data from storage engine Main access methods: ļ§ Table scan ļ§ Index scan ļ§ Ref access ļ§ Range scan ļ§ Index merge ļ§ Loose index scan
14.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Ref Access EXPLAIN SELECT * FROM customer WHERE c_custkey = 570887; Single Table Queries id select type table type possible keys key key len ref rows extra 1 SIMPLE customer const PRIMARY PRIMARY 4 const 1 NULL EXPLAIN SELECT * FROM orders WHERE o_orderdate = ā1992-09-12ā; id select type table type possible keys key key len ref rows extra 1 SIMPLE orders ref i_o_orderdate i_o_orderdate 4 const 6271 NULL
15.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Ref Access Join Queries EXPLAIN SELECT * FROM orders JOIN customer ON c_custkey = o_custkey WHERE o_orderdate = ā1992-09-12ā; Id select type table type possible keys key key len ref rows extra 1 SIMPLE orders ref i_o_orderdate, i_o_custkey i_o_orderdate 4 const 6271 Using where 1 SIMPLE customer eq_ref PRIMARY PRIMARY 4 dbt3.orders. o_custkey 1 NULL
16.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Ref Access Join Queries, continued EXPLAIN SELECT * FROM orders JOIN customer ON c_custkey = o_custkey WHERE c_acctbal < -1000; Id select type table type possible keys key key len ref rows extra 1 SIMPLE customer ALL PRIMARY NULL NULL NULL 1500000 Using where 1 SIMPLE orders ref i_o_custkey i_o_custkey 5 dbt3.customer. c_custkey 7 NULL
17.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Range Optimizer ā¢ Goal: find the āminimalā ranges for each index that needs to be read ā¢ Example: SELECT * FROM t1 WHERE (key1 > 10 AND key1 < 20) AND key2 > 30 ā¢ Range scan using INDEX(key1): ā¢ Range scan using INDEX(key2): 10 20 30
18.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Range Optimizer "analyzing_range_alternatives": { "range_scan_alternatives": [ { "index": "i_a", "ranges": [ "10 < a < 11", "11 < a < 19", "19 < a < 25" ], "index_dives_for_eq_ranges": true, "rowid_ordered": false, "using_mrr": false, "index_only": false, "rows": 3, "cost": 6.61, "chosen": true }, { "index": "i_b", "ranges": [ "NULL < b < 5", "10 < b" ], "index_dives_for_eq_ranges": true, "rowid_ordered": false, ā¦ Optimizer Trace show ranges SELECT a, b FROM t1 WHERE a > 10 AND a < 25 AND a NOT IN (11, 19)) AND (b < 5 OR b > 10);
19.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Range Optimizer: Case Study SELECT * FROM orders WHERE YEAR(o_orderdate) = 1997 AND MONTH(o_orderdate) = 5 AND o_clerk LIKE '%01866'; Why table scan? id select type table type possible keys key key len ref rows extra 1 SIMPLE orders ALL NULL NULL NULL NULL 15000000 Using where Index not considered mysql> SELECT * FROM orders WHERE year(o_orderdate) = 1997 AND MONTH(ā¦ ... 15 rows in set (8.91 sec)
20.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Range Optimizer: Case Study SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' AND '1997-05-31' AND o_clerk LIKE '%01866'; Rewrite query to avoid functions on indexed columns id select type table type possible keys key key len ref rows extra 1 SIMPLE orders range i_o_orderdate i_o_orderdate 4 NULL 376352 Using index condition; Using where mysql> SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' AND ā¦ ... 15 rows in set (0.91 sec)
21.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Range Optimizer: Case Study CREATE INDEX i_o_clerk ON orders(o_clerk); SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' AND '1997-05-31' AND o_clerk LIKE '%01866'; Adding another index id select type table type possible keys key key len ref rows extra 1 SIMPLE orders range i_o_orderdate i_o_orderdate 4 NULL 376352 Using index condition; Using where New index not considered
22.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Range Optimizer: Case Study SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' AND '1997-05-31' AND o_clerk = 'Clerk#000001866'; Rewrite query, again id select type table type possible keys key key len ref rows extra 1 SIMPLE orders range i_o_orderdate, i_o_clerk i_o_clerk 16 NULL 1504 Using index condition; Using where mysql> SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' AND ā¦ ... 15 rows in set (0.01 sec)
23.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Range Access for Multi-part Index ā¢ Table: ā¢ INDEX idx(a, b, c); ā¢ Logical storage layout of index: Example table with multi-part index 10 1 2 3 4 5 10 11 1 2 3 4 5 12 1 2 3 4 5 13 1 2 3 4 5 a b c 11 12 pk a b c
24.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Range Optimizer: Case Study CREATE INDEX i_o_clerk_date ON orders(o_clerk, o_orderdate); SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' AND '1997-05-31' AND o_clerk = 'Clerk#000001866'; Create multi-column index id select type table type possible keys key key len ref row s extra 1 SIMPLE orders range i_o_orderdate, i_o_clerk, i_o_clerk_date i_o_clerk_date 20 NULL 14 Using index condition mysql> SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' AND ā¦ ... 15 rows in set (0.00 sec)
25.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Performance Schema: Query History UPDATE performance_schema.setup_consumers SET enabled='YES' WHERE name = 'events_statements_history'; mysql> SELECT sql_text, (timer_wait)/1000000000.0 āTime (ms)ā, rows_examined FROM performance_schema.events_statements_history ORDER BY timer_start; +---------------------------------------------------------------+--------+------+ | sql_text | Time (ms) | rows_examined | +---------------------------------------------------------------+--------+------+ | SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' ā¦ | 8.1690 | 1505 | | SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' ā¦ | 7.2120 | 1505 | | SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' ā¦ | 8.1613 | 1505 | | SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' ā¦ | 7.0535 | 1505 | | CREATE INDEX i_o_clerk_date ON orders(o_clerk,o_orderdate) |82036.4190 | 0 | | SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' ā¦ | 0.7259 | 15 | | SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' ā¦ | 0.5791 | 15 | | SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' ā¦ | 0.5423 | 15 | | SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' ā¦ | 0.6031 | 15 | | SELECT * FROM orders WHERE o_orderdate BETWEEN '1997-05-01' ā¦ | 0.2710 | 15 | +---------------------------------------------------------------+--------+------+
26.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Program Agenda Introduction to MySQL optimizer Selecting data access method Join optimizer Sorting Tools for monitoring, analyzing, and tuning queries Influencing the Optimizer 1 2 3 4 5 6
27.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Join Optimizer ā¢ Goal: Given a JOIN of N tables, find the best JOIN ordering ā¢ Strategy: ā Start with all 1-table plans ā Expand each plan with remaining tables ā¢ Depth-first ā If ācost of partial planā > ācost of best planā: ā¢ āpruneā plan ā Heuristic pruning: ā¢ Prune less promising partial plans ā¢ May in rare cases miss most optimal plan (turn off with set optimizer_prune_level = 0) āGreedy search strategyā t1 t2 t2 t2 t2 t3 t3 t3 t4t4 t4 t4t4 t3 t3 t2 t4t2 t3
28.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Complexity and Cost of Join Optimizer Heuristics to reduce the number of plans to evaluate: ā¢ Use optimizer_search_depth to limit the number of tables to consider ā¢ Pre-sort tables on size and key dependency order (Improved in MySQL 5.6) ā¢ When adding the next table to a partial plan, add all tables that it has an equality reference to (New in MySQL 5.6) Join of N tables: N! possible plans to evaluate
29.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Join Optimizer: Case study SELECT o_year, SUM(CASE WHEN nation = 'FRANCE' THEN volume ELSE 0 END) / SUM(volume) AS mkt_share FROM ( SELECT EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) AS volume, n2.n_name AS nation FROM part JOIN lineitem ON p_partkey = l_partkey JOIN supplier ON s_suppkey = l_suppkey JOIN orders ON l_orderkey = o_orderkey JOIN customer ON o_custkey = c_custkey JOIN nation n1 ON c_nationkey = n1.n_nationkey JOIN region ON n1.n_regionkey = r_regionkey JOIN nation n2 ON s_nationkey = n2.n_nationkey WHERE r_name = 'EUROPEā AND o_orderdate BETWEEN '1995-01-01' AND '1996-12-31ā AND p_type = 'PROMO BRUSHED STEEL' ) AS all_nations GROUP BY o_year ORDER BY o_year; DBT-3 Query 8: National Market Share Query
30.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Join Optimizer: Case Study MySQL Workbench: Visual EXPLAIN Execution time: 3 min. 28 sec.
31.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Join Optimizer: Case study SELECT o_year, SUM(CASE WHEN nation = 'FRANCE' THEN volume ELSE 0 END) / SUM(volume) AS mkt_share FROM ( SELECT EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) AS volume, n2.n_name AS nation FROM part STRAIGHT_JOIN lineitem ON p_partkey = l_partkey JOIN supplier ON s_suppkey = l_suppkey JOIN orders ON l_orderkey = o_orderkey JOIN customer ON o_custkey = c_custkey JOIN nation n1 ON c_nationkey = n1.n_nationkey JOIN region ON n1.n_regionkey = r_regionkey JOIN nation n2 ON s_nationkey = n2.n_nationkey WHERE r_name = 'EUROPEā AND o_orderdate BETWEEN '1995-01-01' AND '1996-12-31ā AND p_type = 'PROMO BRUSHED STEEL' ) AS all_nations GROUP BY o_year ORDER BY o_year; Force early processing of high selectivity predicates Highest selectivity part before lineitem
32.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Join Optimizer: Case study Improved join order Execution time: 7 seconds
33.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. MySQL 5.7: Cost Information in Structured EXPLAIN
34.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Program Agenda Introduction to MySQL optimizer Selecting data access method Join optimizer Sorting Tools for monitoring, analyzing, and tuning queries Influencing the Optimizer 1 2 3 4 5 6
35.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. ORDER BY Optimizations ā¢ General solution; āFilesortā: ā Store query result in temporary table before sorting ā If data volume is large, may need to sort in several passes with intermediate storage on disk. ā¢ Optimizations: ā Take advantage of index to generate query result in sorted order ā For āLIMIT nā queries, maintain priority queue of n top items in memory instead of filesort. (New in MySQL 5.6)
36.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Filesort SELECT * FROM orders ORDER BY o_totalprice ; SELECT c_name, o_orderkey, o_totalprice FROM orders JOIN customer ON c_custkey = o_custkey WHERE c_acctbal < -1000 ORDER BY o_totalprice ; id select type table type possible keys key key len ref rows extra 1 SIMPLE customer ALL PRIMARY NULL NULL NULL 1500000 Using where; Using temporary; Using filesort 1 SIMPLE orders ref i_o_custkey i_o_custkey 5 ... 7 NULL id select type table type possible keys key key len ref rows extra 1 SIMPLE orders ALL NULL NULL NULL NULL 15000000 Using filesort
37.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Filesort Status variables related to sorting: mysql> show status like 'Sort%'; +-------------------+--------+ | Variable_name | Value | +-------------------+--------+ | Sort_merge_passes | 1 | | Sort_range | 0 | | Sort_rows | 136170 | | Sort_scan | 1 | +-------------------+--------+ Status variables >0: Intermediate storage on disk. Consider increasing sort_buffer_size Number of sort operations (range scan or table/index scans) Number of rows sorted
38.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. mysql> FLUSH STATUS; Query OK, 0 rows affected (0.00 sec) mysql> SELECT AVG(o_totalprice) FROM ( SELECT * FROM orders ORDER BY o_totalprice DESC LIMIT 100000) td; +-------------------+ | AVG(o_totalprice) | +-------------------+ | 398185.986158 | +-------------------+ 1 row in set (24.65 sec) mysql> SHOW STATUS LIKE 'sort%'; +-------------------+--------+ | Variable_name | Value | +-------------------+--------+ | Sort_merge_passes | 1432 | | Sort_range | 0 | | Sort_rows | 100000 | | Sort_scan | 1 | +-------------------+--------+ 4 rows in set (0.00 sec) Filesort: Case Study Unnecessary large data volume! Many intermediate sorting steps!
39.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. mysql> FLUSH STATUS; Query OK, 0 rows affected (0.00 sec) mysql> SELECT AVG(o_totalprice) FROM ( SELECT o_totalprice FROM orders ORDER BY o_totalprice DESC LIMIT 100000) td; +-------------------+ | AVG(o_totalprice) | +-------------------+ | 398185.986158 | +-------------------+ 1 row in set (8.18 sec) mysql> SHOW STATUS LIKE 'sort%'; +-------------------+--------+ | Variable_name | Value | +-------------------+--------+ | Sort_merge_passes | 229 | | Sort_range | 0 | | Sort_rows | 100000 | | Sort_scan | 1 | +-------------------+--------+ 4 rows in set (0.00 sec) Filesort: Case Study Reduce amount of data to be sorted
40.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. mysql> set sort_buffer_size=1024*1024; mysql> FLUSH STATUS; Query OK, 0 rows affected (0.00 sec) mysql> SELECT AVG(o_totalprice) FROM ( SELECT o_totalprice FROM orders ORDER BY o_totalprice DESC LIMIT 100000) td; +-------------------+ | AVG(o_totalprice) | +-------------------+ | 398185.986158 | +-------------------+ 1 row in set (7.24 sec) mysql> SHOW STATUS LIKE 'sort%'; +-------------------+--------+ | Variable_name | Value | +-------------------+--------+ | Sort_merge_passes | 57 | | Sort_range | 0 | | Sort_rows | 100000 | | Sort_scan | 1 | +-------------------+--------+ 4 rows in set (0.00 sec) Filesort: Case Study Increase sort buffer (1 MB) Default is 256 kB
41.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. mysql> set sort_buffer_size=8*1024*1024; mysql> FLUSH STATUS; Query OK, 0 rows affected (0.00 sec) mysql> SELECT AVG(o_totalprice) FROM ( SELECT o_totalprice FROM orders ORDER BY o_totalprice DESC LIMIT 100000) td; +-------------------+ | AVG(o_totalprice) | +-------------------+ | 398185.986158 | +-------------------+ 1 row in set (6.30 sec) mysql> SHOW STATUS LIKE 'sort%'; +-------------------+--------+ | Variable_name | Value | +-------------------+--------+ | Sort_merge_passes | 0 | | Sort_range | 0 | | Sort_rows | 100000 | | Sort_scan | 1 | +-------------------+--------+ 4 rows in set (0.00 sec) Filesort: Case Study Increase sort buffer even more (8 MB) NB! Bigger sort buffer than needed will give unnecessary overhead
42.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Use Index to Avoid Sorting CREATE INDEX i_o_totalprice ON orders(o_totalprice); SELECT AVG(o_totalprice) FROM (SELECT o_totalprice FROM orders ORDER BY o_totalprice DESC LIMIT 100000) td; id select type table Type possible keys key key len ref rows extra 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 100000 NULL 2 DERIVED orders index NULL i_o_totalprice 6 NULL 15000000 Using index mysql> SELECT AVG(o_totalprice) FROM ( SELECT o_totalprice FROM orders ORDER BY o_totalprice DESC LIMIT 100000) td; ... 1 row in set (0.06 sec)
43.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Program Agenda Introduction to MySQL optimizer Selecting data access method Join optimizer Sorting Tools for monitoring, analyzing, and tuning queries Influencing the Optimizer 1 2 3 4 5 6
44.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Useful tools ā¢ MySQL Enterprise Monitor (MEM), Query Analyzer ā Commercial product ā¢ Performance schema, MySQL sys schema ā¢ EXPLAIN ā¢ EXPLAIN FORMAT=JSON ā¢ Optimizer trace ā¢ Slow log ā¢ Status variables (SHOW STATUS LIKE āHandler%ā)
45.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. MySQL Enterprise Monitor, Query Analyzer
46.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Query Analyzer Query Details
47.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Performance Schema ā¢ events_statements_history events_statements_history_long ā Most recent statements executed ā¢ events_statements_summary_by_digest ā Summary for similar statements (same statement digest) ā¢ file_summary_by_event_name ā Interesting event: wait/io/file/innodb/innodb_data_file ā¢ table_io_waits_summary_by_table table_io_waits_summary_by_index_usage ā Statistics on storage engine access per table and index Some useful tables
48.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Performance Schema ā¢ Normalization of queries to group statements that are similar to be grouped and summarized: SELECT * FROM orders WHERE o_custkey=10 AND o_totalprice>20 SELECT * FROM orders WHERE o_custkey = 20 AND o_totalprice > 100 SELECT * FROM orders WHERE o_custkey = ? AND o_totalprice > ? ā¢ events_statements_summary_by_digest DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_TIMER_WAIT, MIN_TIMER_WAIT, AVG_TIMER_WAIT, MAX_TIMER_WAIT, SUM_LOCK_TIME, SUM_ERRORS, SUM_WARNINGS, SUM_ROWS_AFFECTED, SUM_ROWS_SENT, SUM_ROWS_EXAMINED, SUM_CREATED_TMP_DISK_TABLES, SUM_CREATED_TMP_TABLES, SUM_SELECT_FULL_JOIN, SUM_SELECT_FULL_RANGE_JOIN, SUM_SELECT_RANGE, SUM_SELECT_RANGE_CHECK, SUM_SELECT_SCAN, SUM_SORT_MERGE_PASSES, SUM_SORT_RANGE, SUM_SORT_ROWS, SUM_SORT_SCAN, SUM_NO_INDEX_USED, SUM_NO_GOOD_INDEX_USED, FIRST_SEEN, LAST_SEEN Statement digest
49.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Performance Schema ā¢ Tables: events_statements_current (Current statement for each thread) events_statements_history (10 most recent statements per thread) events_statements_history_long (10000 most recent statements) ā¢ Columns: THREAD_ID, EVENT_ID, END_EVENT_ID, EVENT_NAME, SOURCE, TIMER_START, TIMER_END, TIMER_WAIT, LOCK_TIME, SQL_TEXT, DIGEST, DIGEST_TEXT, CURRENT_SCHEMA, OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME, OBJECT_INSTANCE_BEGIN, MYSQL_ERRNO, RETURNED_SQLSTATE, MESSAGE_TEXT, ERRORS, WARNINGS, ROWS_AFFECTED, ROWS_SENT, ROWS_EXAMINED, CREATED_TMP_DISK_TABLES, CREATED_TMP_TABLES, SELECT_FULL_JOIN, SELECT_FULL_RANGE_JOIN, SELECT_RANGE, SELECT_RANGE_CHECK, SELECT_SCAN, SORT_MERGE_PASSES, SORT_RANGE, SORT_ROWS, SORT_SCAN, NO_INDEX_USED, NO_GOOD_INDEX_USED, NESTING_EVENT_ID, NESTING_EVENT_TYPE Statement events
50.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. MySQL sys Schema / ps_helper ā¢ Started as a collection of views, procedures and functions, designed to make reading raw Performance Schema data easier ā¢ Implements many common DBA and Developer use cases ā¢ Now bundled within MySQL Workbench ā¢ Available on GitHub ā https://github.com/MarkLeith/mysql-sys ā¢ Examples of very useful functions: ā format_time() , format_bytes(), format_statement()
51.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. MySQL sys Schema statement_analysis: Lists a normalized statement view with aggregated statistics, mimics the MySQL Enterprise Monitor Query Analysis view, ordered by the total execution time per normalized statement mysql> select * from statement_analysis limit 1G *************************** 1. row *************************** query: INSERT INTO `mem__quan` . `nor ... nDuration` = IF ( VALUES ( ... db: mem full_scan: exec_count: 1110067 err_count: 0 warn_count: 0 total_latency: 1.93h max_latency: 5.03 s avg_latency: 6.27 ms Example lock_latency: 00:18:29.18 rows_sent: 0 rows_sent_avg: 0 rows_examined: 0 rows_examined_avg: 0 tmp_tables: 0 tmp_disk_tables: 0 rows_sorted: 0 sort_merge_passes: 0 digest: d48316a218e95b1b8b72db5e6b177788! first_seen: 2014-05-20 10:42:17
52.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Optimizer Trace: Query Plan Debugging ā¢ EXPLAIN shows the selected plan ā¢ TRACE shows WHY the plan was selected: ā Alternative plans ā Estimated costs ā Decisions made ā¢ JSON format
53.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Optimizer Trace: Example SET optimizer_trace= āenabled=onā, end_markers_in_json=on; SELECT * FROM t1, t2 WHERE f1=1 AND f1=f2 AND f2>0; SELECT trace INTO DUMPFILE <filename> FROM information_schema.optimizer_trace; SET optimizer_trace="enabled=off"; QUERY SELECT * FROM t1,t2 WHERE f1=1 AND f1=f2 AND f2>0; TRACE āstepsā: [ { "join_preparation": { "select#": 1,ā¦ } ā¦ } ā¦] MISSING_BYTES_BEYOND_MAX_MEM_SIZE 0 INSUFFICIENT_PRIVILEGES 0
54.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. 5 Program Agenda Introduction to MySQL optimizer Selecting data access method Join optimizer Sorting Tools for monitoring, analyzing, and tuning queries Influencing the Optimizer 1 2 3 4 6
55.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Influencing the Optimizer ā¢ Add indexes ā¢ Force use of specific indexes: ā USE INDEX, FORCE INDEX, IGNORE INDEX ā¢ Force specific join order: ā STRAIGHT_JOIN ā¢ Adjust session variables ā optimizer_switch flags: set optimizer_switch=āindex_merge=offā ā Buffer sizes: set sort_buffer=8*1024*1024; ā Other variables: set optimizer_prune_level = 0; When the optimizer does not do what you want
56.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. More information ā¢ My blog: ā http://oysteing.blogspot.com/ ā¢ Optimizer team blog: ā http://mysqloptimizerteam.blogspot.com/ ā¢ MySQL Server Team blog ā http://mysqlserverteam.com/ ā¢ MySQL forums: ā Optimizer & Parser: http://forums.mysql.com/list.php?115 ā Performance: http://forums.mysql.com/list.php?24
57.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Safe Harbor Statement The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracleās products remains at the sole discretion of Oracle. 57
58.
Copyright Ā© 2015,
Oracle and/or its affiliates. All rights reserved. Q&A Copyright Ā© 2015, Oracle and/or its affiliates. All rights reserved.
Download now