Submit Search
Upload
MySQL Query Optimization
ā¢
4 likes
ā¢
1,848 views
Morgan Tocker
Follow
ZendCon 2014 Presentation
Read less
Read more
Software
Report
Share
Report
Share
1 of 51
Download now
Download to read offline
Recommended
MySQL 8.0 Optimizer Guide
MySQL 8.0 Optimizer Guide
Morgan Tocker
Ā
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder
Ā
MySQL Database Architectures - 2020-10
MySQL Database Architectures - 2020-10
Kenny Gryp
Ā
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
Miguel AraĆŗjo
Ā
MySQL Shell for DBAs
MySQL Shell for DBAs
Frederic Descamps
Ā
MySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & Demo
Keith Hollman
Ā
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performance
oysteing
Ā
Building ClickHouse and Making Your First Contribution: A Tutorial_06.10.2021
Building ClickHouse and Making Your First Contribution: A Tutorial_06.10.2021
Altinity Ltd
Ā
Recommended
MySQL 8.0 Optimizer Guide
MySQL 8.0 Optimizer Guide
Morgan Tocker
Ā
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder
Ā
MySQL Database Architectures - 2020-10
MySQL Database Architectures - 2020-10
Kenny Gryp
Ā
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
Miguel AraĆŗjo
Ā
MySQL Shell for DBAs
MySQL Shell for DBAs
Frederic Descamps
Ā
MySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & Demo
Keith Hollman
Ā
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performance
oysteing
Ā
Building ClickHouse and Making Your First Contribution: A Tutorial_06.10.2021
Building ClickHouse and Making Your First Contribution: A Tutorial_06.10.2021
Altinity Ltd
Ā
Performance Schema and Sys Schema in MySQL 5.7
Performance Schema and Sys Schema in MySQL 5.7
Mark Leith
Ā
PhĆ¢n tĆch, thiįŗæt kįŗæ hį» thį»ng thĆ“ng tin quįŗ£n lĆ½ nhĆ¢n sį»± tįŗ”i CĆ“ng ty Du Lį»ch
PhĆ¢n tĆch, thiįŗæt kįŗæ hį» thį»ng thĆ“ng tin quįŗ£n lĆ½ nhĆ¢n sį»± tįŗ”i CĆ“ng ty Du Lį»ch
Dį»ch vį»„ LĆ m Luįŗn VÄn 0936885877
Ā
PhĆ¢n tĆch cįŗ£m xĆŗc trong tiįŗæng viį»t bįŗ±ng phĘ°Ę”ng phĆ”p mĆ”y hį»c.pdf
PhĆ¢n tĆch cįŗ£m xĆŗc trong tiįŗæng viį»t bįŗ±ng phĘ°Ę”ng phĆ”p mĆ”y hį»c.pdf
Man_Ebook
Ā
Lab mcsa 2016 tieng viet new star
Lab mcsa 2016 tieng viet new star
Ninhnd Nguyen
Ā
bao cao linux
bao cao linux
binhnv186
Ā
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Miguel AraĆŗjo
Ā
NghiĆŖn cį»©u vĆ triį»n khai hį» thį»ng Private Cloud cho cĆ”c į»©ng dį»„ng ÄĆ o tįŗ”o vĆ t...
NghiĆŖn cį»©u vĆ triį»n khai hį» thį»ng Private Cloud cho cĆ”c į»©ng dį»„ng ÄĆ o tįŗ”o vĆ t...
Nhįŗn Viįŗæt Äį» TĆ i Trį»n GĆ³i ZALO 0932091562
Ā
MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
Sveta Smirnova
Ā
MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA Tool
Miguel AraĆŗjo
Ā
[Äį» Ć”n mĆ“n hį»c] - Äį» tĆ i: NghiĆŖn cį»©u xĆ¢y dį»±ng giįŗ£i phĆ”p thu thįŗp vĆ quįŗ£n lĆ½ ...
[Äį» Ć”n mĆ“n hį»c] - Äį» tĆ i: NghiĆŖn cį»©u xĆ¢y dį»±ng giįŗ£i phĆ”p thu thįŗp vĆ quįŗ£n lĆ½ ...
Ć NhĘ° LĆŖ
Ā
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
Kenny Gryp
Ā
JSON improvements in MySQL 8.0
JSON improvements in MySQL 8.0
Mydbops
Ā
Luįŗn vÄn: TƬm hiį»u giįŗ£i phĆ”p įŗ£o hĆ³a docker vĆ į»©ng dį»„ng, HOT
Luįŗn vÄn: TƬm hiį»u giįŗ£i phĆ”p įŗ£o hĆ³a docker vĆ į»©ng dį»„ng, HOT
Dį»ch vį»„ viįŗæt bĆ i trį»n gĆ³i ZALO 0917193864
Ā
BĆ i giįŗ£ng an toĆ n į»©ng dį»„ng web vĆ csdl PTIT
BĆ i giįŗ£ng an toĆ n į»©ng dį»„ng web vĆ csdl PTIT
NguynMinh294
Ā
The MySQL Query Optimizer Explained Through Optimizer Trace
The MySQL Query Optimizer Explained Through Optimizer Trace
oysteing
Ā
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
Frederic Descamps
Ā
AWS RDS Benchmark - Instance comparison
AWS RDS Benchmark - Instance comparison
Roberto Gaiser
Ā
Sį» dį»„ng API Leaflet chi tiįŗæt cĆ”c chį»©c nÄng
Sį» dį»„ng API Leaflet chi tiįŗæt cĆ”c chį»©c nÄng
Hao CT
Ā
Lįŗp trƬnh hĘ°į»ng Äį»i tĘ°į»£ng vį»i C++
Lįŗp trƬnh hĘ°į»ng Äį»i tĘ°į»£ng vį»i C++
Trįŗ§n ThiĆŖn Äįŗ”i
Ā
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
Altinity Ltd
Ā
MySQL Architecture and Engine
MySQL Architecture and Engine
Abdul Manaf
Ā
MariaDB: Connect Storage Engine
MariaDB: Connect Storage Engine
Kangaroot
Ā
More Related Content
What's hot
Performance Schema and Sys Schema in MySQL 5.7
Performance Schema and Sys Schema in MySQL 5.7
Mark Leith
Ā
PhĆ¢n tĆch, thiįŗæt kįŗæ hį» thį»ng thĆ“ng tin quįŗ£n lĆ½ nhĆ¢n sį»± tįŗ”i CĆ“ng ty Du Lį»ch
PhĆ¢n tĆch, thiįŗæt kįŗæ hį» thį»ng thĆ“ng tin quįŗ£n lĆ½ nhĆ¢n sį»± tįŗ”i CĆ“ng ty Du Lį»ch
Dį»ch vį»„ LĆ m Luįŗn VÄn 0936885877
Ā
PhĆ¢n tĆch cįŗ£m xĆŗc trong tiįŗæng viį»t bįŗ±ng phĘ°Ę”ng phĆ”p mĆ”y hį»c.pdf
PhĆ¢n tĆch cįŗ£m xĆŗc trong tiįŗæng viį»t bįŗ±ng phĘ°Ę”ng phĆ”p mĆ”y hį»c.pdf
Man_Ebook
Ā
Lab mcsa 2016 tieng viet new star
Lab mcsa 2016 tieng viet new star
Ninhnd Nguyen
Ā
bao cao linux
bao cao linux
binhnv186
Ā
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Miguel AraĆŗjo
Ā
NghiĆŖn cį»©u vĆ triį»n khai hį» thį»ng Private Cloud cho cĆ”c į»©ng dį»„ng ÄĆ o tįŗ”o vĆ t...
NghiĆŖn cį»©u vĆ triį»n khai hį» thį»ng Private Cloud cho cĆ”c į»©ng dį»„ng ÄĆ o tįŗ”o vĆ t...
Nhįŗn Viįŗæt Äį» TĆ i Trį»n GĆ³i ZALO 0932091562
Ā
MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
Sveta Smirnova
Ā
MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA Tool
Miguel AraĆŗjo
Ā
[Äį» Ć”n mĆ“n hį»c] - Äį» tĆ i: NghiĆŖn cį»©u xĆ¢y dį»±ng giįŗ£i phĆ”p thu thįŗp vĆ quįŗ£n lĆ½ ...
[Äį» Ć”n mĆ“n hį»c] - Äį» tĆ i: NghiĆŖn cį»©u xĆ¢y dį»±ng giįŗ£i phĆ”p thu thįŗp vĆ quįŗ£n lĆ½ ...
Ć NhĘ° LĆŖ
Ā
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
Kenny Gryp
Ā
JSON improvements in MySQL 8.0
JSON improvements in MySQL 8.0
Mydbops
Ā
Luįŗn vÄn: TƬm hiį»u giįŗ£i phĆ”p įŗ£o hĆ³a docker vĆ į»©ng dį»„ng, HOT
Luįŗn vÄn: TƬm hiį»u giįŗ£i phĆ”p įŗ£o hĆ³a docker vĆ į»©ng dį»„ng, HOT
Dį»ch vį»„ viįŗæt bĆ i trį»n gĆ³i ZALO 0917193864
Ā
BĆ i giįŗ£ng an toĆ n į»©ng dį»„ng web vĆ csdl PTIT
BĆ i giįŗ£ng an toĆ n į»©ng dį»„ng web vĆ csdl PTIT
NguynMinh294
Ā
The MySQL Query Optimizer Explained Through Optimizer Trace
The MySQL Query Optimizer Explained Through Optimizer Trace
oysteing
Ā
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
Frederic Descamps
Ā
AWS RDS Benchmark - Instance comparison
AWS RDS Benchmark - Instance comparison
Roberto Gaiser
Ā
Sį» dį»„ng API Leaflet chi tiįŗæt cĆ”c chį»©c nÄng
Sį» dį»„ng API Leaflet chi tiįŗæt cĆ”c chį»©c nÄng
Hao CT
Ā
Lįŗp trƬnh hĘ°į»ng Äį»i tĘ°į»£ng vį»i C++
Lįŗp trƬnh hĘ°į»ng Äį»i tĘ°į»£ng vį»i C++
Trįŗ§n ThiĆŖn Äįŗ”i
Ā
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
Altinity Ltd
Ā
What's hot
(20)
Performance Schema and Sys Schema in MySQL 5.7
Performance Schema and Sys Schema in MySQL 5.7
Ā
PhĆ¢n tĆch, thiįŗæt kįŗæ hį» thį»ng thĆ“ng tin quįŗ£n lĆ½ nhĆ¢n sį»± tįŗ”i CĆ“ng ty Du Lį»ch
PhĆ¢n tĆch, thiįŗæt kįŗæ hį» thį»ng thĆ“ng tin quįŗ£n lĆ½ nhĆ¢n sį»± tįŗ”i CĆ“ng ty Du Lį»ch
Ā
PhĆ¢n tĆch cįŗ£m xĆŗc trong tiįŗæng viį»t bįŗ±ng phĘ°Ę”ng phĆ”p mĆ”y hį»c.pdf
PhĆ¢n tĆch cįŗ£m xĆŗc trong tiįŗæng viį»t bįŗ±ng phĘ°Ę”ng phĆ”p mĆ”y hį»c.pdf
Ā
Lab mcsa 2016 tieng viet new star
Lab mcsa 2016 tieng viet new star
Ā
bao cao linux
bao cao linux
Ā
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Ā
NghiĆŖn cį»©u vĆ triį»n khai hį» thį»ng Private Cloud cho cĆ”c į»©ng dį»„ng ÄĆ o tįŗ”o vĆ t...
NghiĆŖn cį»©u vĆ triį»n khai hį» thį»ng Private Cloud cho cĆ”c į»©ng dį»„ng ÄĆ o tįŗ”o vĆ t...
Ā
MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
Ā
MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA Tool
Ā
[Äį» Ć”n mĆ“n hį»c] - Äį» tĆ i: NghiĆŖn cį»©u xĆ¢y dį»±ng giįŗ£i phĆ”p thu thįŗp vĆ quįŗ£n lĆ½ ...
[Äį» Ć”n mĆ“n hį»c] - Äį» tĆ i: NghiĆŖn cį»©u xĆ¢y dį»±ng giįŗ£i phĆ”p thu thįŗp vĆ quįŗ£n lĆ½ ...
Ā
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
Ā
JSON improvements in MySQL 8.0
JSON improvements in MySQL 8.0
Ā
Luįŗn vÄn: TƬm hiį»u giįŗ£i phĆ”p įŗ£o hĆ³a docker vĆ į»©ng dį»„ng, HOT
Luįŗn vÄn: TƬm hiį»u giįŗ£i phĆ”p įŗ£o hĆ³a docker vĆ į»©ng dį»„ng, HOT
Ā
BĆ i giįŗ£ng an toĆ n į»©ng dį»„ng web vĆ csdl PTIT
BĆ i giįŗ£ng an toĆ n į»©ng dį»„ng web vĆ csdl PTIT
Ā
The MySQL Query Optimizer Explained Through Optimizer Trace
The MySQL Query Optimizer Explained Through Optimizer Trace
Ā
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
Ā
AWS RDS Benchmark - Instance comparison
AWS RDS Benchmark - Instance comparison
Ā
Sį» dį»„ng API Leaflet chi tiįŗæt cĆ”c chį»©c nÄng
Sį» dį»„ng API Leaflet chi tiįŗæt cĆ”c chį»©c nÄng
Ā
Lįŗp trƬnh hĘ°į»ng Äį»i tĘ°į»£ng vį»i C++
Lįŗp trƬnh hĘ°į»ng Äį»i tĘ°į»£ng vį»i C++
Ā
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
Ā
Viewers also liked
MySQL Architecture and Engine
MySQL Architecture and Engine
Abdul Manaf
Ā
MariaDB: Connect Storage Engine
MariaDB: Connect Storage Engine
Kangaroot
Ā
InnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter Zaitsev
Fuenteovejuna
Ā
Building High Performance MySql Query Systems And Analytic Applications
Building High Performance MySql Query Systems And Analytic Applications
guest40cda0b
Ā
Zurich2007 MySQL Query Optimization
Zurich2007 MySQL Query Optimization
Hiį»p LĆŖ Tuįŗ„n
Ā
Advanced MySQL Query Tuning
Advanced MySQL Query Tuning
Alexander Rubin
Ā
MySQL Query Tuning for the Squeemish -- Fossetcon Orlando Sep 2014
MySQL Query Tuning for the Squeemish -- Fossetcon Orlando Sep 2014
Dave Stokes
Ā
56 Query Optimization
56 Query Optimization
MYXPLAIN
Ā
MYSQL Query Anti-Patterns That Can Be Moved to Sphinx
MYSQL Query Anti-Patterns That Can Be Moved to Sphinx
Pythian
Ā
Mysql query optimization
Mysql query optimization
Baohua Cai
Ā
Query Optimization with MySQL 5.6: Old and New Tricks
Query Optimization with MySQL 5.6: Old and New Tricks
MYXPLAIN
Ā
Locking and Concurrency Control
Locking and Concurrency Control
Morgan Tocker
Ā
Tunning sql query
Tunning sql query
vuhaininh88
Ā
MySQL Query tuning 101
MySQL Query tuning 101
Sveta Smirnova
Ā
ļæ¼Advanced MySQL Query and Schema Tuning
ļæ¼Advanced MySQL Query and Schema Tuning
MYXPLAIN
Ā
My sql optimization
My sql optimization
PrelovacMedia
Ā
Optimizing MySQL
Optimizing MySQL
Morgan Tocker
Ā
Webinar 2013 advanced_query_tuning
Webinar 2013 advanced_query_tuning
ę åØ
Ā
MySQL Query Optimization.
MySQL Query Optimization.
Remote MySQL DBA
Ā
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
Ā
Viewers also liked
(20)
MySQL Architecture and Engine
MySQL Architecture and Engine
Ā
MariaDB: Connect Storage Engine
MariaDB: Connect Storage Engine
Ā
InnoDB Architecture and Performance Optimization, Peter Zaitsev
InnoDB Architecture and Performance Optimization, Peter Zaitsev
Ā
Building High Performance MySql Query Systems And Analytic Applications
Building High Performance MySql Query Systems And Analytic Applications
Ā
Zurich2007 MySQL Query Optimization
Zurich2007 MySQL Query Optimization
Ā
Advanced MySQL Query Tuning
Advanced MySQL Query Tuning
Ā
MySQL Query Tuning for the Squeemish -- Fossetcon Orlando Sep 2014
MySQL Query Tuning for the Squeemish -- Fossetcon Orlando Sep 2014
Ā
56 Query Optimization
56 Query Optimization
Ā
MYSQL Query Anti-Patterns That Can Be Moved to Sphinx
MYSQL Query Anti-Patterns That Can Be Moved to Sphinx
Ā
Mysql query optimization
Mysql query optimization
Ā
Query Optimization with MySQL 5.6: Old and New Tricks
Query Optimization with MySQL 5.6: Old and New Tricks
Ā
Locking and Concurrency Control
Locking and Concurrency Control
Ā
Tunning sql query
Tunning sql query
Ā
MySQL Query tuning 101
MySQL Query tuning 101
Ā
ļæ¼Advanced MySQL Query and Schema Tuning
ļæ¼Advanced MySQL Query and Schema Tuning
Ā
My sql optimization
My sql optimization
Ā
Optimizing MySQL
Optimizing MySQL
Ā
Webinar 2013 advanced_query_tuning
Webinar 2013 advanced_query_tuning
Ā
MySQL Query Optimization.
MySQL Query Optimization.
Ā
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
Ā
Similar to MySQL Query Optimization
MySQL 8.0 Released Update
MySQL 8.0 Released Update
Keith Hollman
Ā
Five more things about Oracle SQL and PLSQL
Five more things about Oracle SQL and PLSQL
Connor McDonald
Ā
Solr JDBC - Lucene/Solr Revolution 2016
Solr JDBC - Lucene/Solr Revolution 2016
Kevin Risden
Ā
Histogram Support in MySQL 8.0
Histogram Support in MySQL 8.0
oysteing
Ā
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
Carlos Oliveira
Ā
Developers' mDay 2017. - Bogdan Kecman Oracle
Developers' mDay 2017. - Bogdan Kecman Oracle
mCloud
Ā
Developersā mDay u Banjoj Luci - Bogdan Kecman, Oracle ā MySQL Server 8.0
Developersā mDay u Banjoj Luci - Bogdan Kecman, Oracle ā MySQL Server 8.0
mCloud
Ā
Advanced SQL - Quebec 2014
Advanced SQL - Quebec 2014
Connor McDonald
Ā
Day 6.pptx
Day 6.pptx
atreesgalaxy
Ā
Lessons learned from Isbank - A Story of a DB2 for z/OS Initiative
Lessons learned from Isbank - A Story of a DB2 for z/OS Initiative
Cuneyt Goksu
Ā
Solr JDBC: Presented by Kevin Risden, Avalon Consulting
Solr JDBC: Presented by Kevin Risden, Avalon Consulting
Lucidworks
Ā
Top 10 tips for Oracle performance
Top 10 tips for Oracle performance
Guy Harrison
Ā
MySQL 5.7: Core Server Changes
MySQL 5.7: Core Server Changes
Morgan Tocker
Ā
How to analyze and tune sql queries for better performance percona15
How to analyze and tune sql queries for better performance percona15
oysteing
Ā
OQL querying and indexes with Apache Geode (incubating)
OQL querying and indexes with Apache Geode (incubating)
Jason Huynh
Ā
What's New MySQL 8.0?
What's New MySQL 8.0?
OracleMySQL
Ā
MySQL Troubleshooting with the Performance Schema
MySQL Troubleshooting with the Performance Schema
Sveta Smirnova
Ā
Confoo 2021 - MySQL Indexes & Histograms
Confoo 2021 - MySQL Indexes & Histograms
Dave Stokes
Ā
How to analyze and tune sql queries for better performance webinar
How to analyze and tune sql queries for better performance webinar
oysteing
Ā
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
Dave Stokes
Ā
Similar to MySQL Query Optimization
(20)
MySQL 8.0 Released Update
MySQL 8.0 Released Update
Ā
Five more things about Oracle SQL and PLSQL
Five more things about Oracle SQL and PLSQL
Ā
Solr JDBC - Lucene/Solr Revolution 2016
Solr JDBC - Lucene/Solr Revolution 2016
Ā
Histogram Support in MySQL 8.0
Histogram Support in MySQL 8.0
Ā
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
Ā
Developers' mDay 2017. - Bogdan Kecman Oracle
Developers' mDay 2017. - Bogdan Kecman Oracle
Ā
Developersā mDay u Banjoj Luci - Bogdan Kecman, Oracle ā MySQL Server 8.0
Developersā mDay u Banjoj Luci - Bogdan Kecman, Oracle ā MySQL Server 8.0
Ā
Advanced SQL - Quebec 2014
Advanced SQL - Quebec 2014
Ā
Day 6.pptx
Day 6.pptx
Ā
Lessons learned from Isbank - A Story of a DB2 for z/OS Initiative
Lessons learned from Isbank - A Story of a DB2 for z/OS Initiative
Ā
Solr JDBC: Presented by Kevin Risden, Avalon Consulting
Solr JDBC: Presented by Kevin Risden, Avalon Consulting
Ā
Top 10 tips for Oracle performance
Top 10 tips for Oracle performance
Ā
MySQL 5.7: Core Server Changes
MySQL 5.7: Core Server Changes
Ā
How to analyze and tune sql queries for better performance percona15
How to analyze and tune sql queries for better performance percona15
Ā
OQL querying and indexes with Apache Geode (incubating)
OQL querying and indexes with Apache Geode (incubating)
Ā
What's New MySQL 8.0?
What's New MySQL 8.0?
Ā
MySQL Troubleshooting with the Performance Schema
MySQL Troubleshooting with the Performance Schema
Ā
Confoo 2021 - MySQL Indexes & Histograms
Confoo 2021 - MySQL Indexes & Histograms
Ā
How to analyze and tune sql queries for better performance webinar
How to analyze and tune sql queries for better performance webinar
Ā
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
Ā
More from Morgan Tocker
Introducing Spirit - Online Schema Change
Introducing Spirit - Online Schema Change
Morgan Tocker
Ā
MySQL Usability Guidelines
MySQL Usability Guidelines
Morgan Tocker
Ā
My First 90 days with Vitess
My First 90 days with Vitess
Morgan Tocker
Ā
FOSDEM MySQL and Friends Devroom
FOSDEM MySQL and Friends Devroom
Morgan Tocker
Ā
Introducing TiDB - Percona Live Frankfurt
Introducing TiDB - Percona Live Frankfurt
Morgan Tocker
Ā
TiDB Introduction - Boston MySQL Meetup Group
TiDB Introduction - Boston MySQL Meetup Group
Morgan Tocker
Ā
TiDB Introduction - San Francisco MySQL Meetup
TiDB Introduction - San Francisco MySQL Meetup
Morgan Tocker
Ā
TiDB Introduction
TiDB Introduction
Morgan Tocker
Ā
MySQL Server Defaults
MySQL Server Defaults
Morgan Tocker
Ā
MySQL Cloud Service Deep Dive
MySQL Cloud Service Deep Dive
Morgan Tocker
Ā
MySQL 5.7 + JSON
MySQL 5.7 + JSON
Morgan Tocker
Ā
Using MySQL in Automated Testing
Using MySQL in Automated Testing
Morgan Tocker
Ā
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7
Morgan Tocker
Ā
MySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
Morgan Tocker
Ā
MySQL For Linux Sysadmins
MySQL For Linux Sysadmins
Morgan Tocker
Ā
MySQL: From Single Instance to Big Data
MySQL: From Single Instance to Big Data
Morgan Tocker
Ā
MySQL NoSQL APIs
MySQL NoSQL APIs
Morgan Tocker
Ā
MySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics Improvements
Morgan Tocker
Ā
The InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQL
Morgan Tocker
Ā
My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2
Morgan Tocker
Ā
More from Morgan Tocker
(20)
Introducing Spirit - Online Schema Change
Introducing Spirit - Online Schema Change
Ā
MySQL Usability Guidelines
MySQL Usability Guidelines
Ā
My First 90 days with Vitess
My First 90 days with Vitess
Ā
FOSDEM MySQL and Friends Devroom
FOSDEM MySQL and Friends Devroom
Ā
Introducing TiDB - Percona Live Frankfurt
Introducing TiDB - Percona Live Frankfurt
Ā
TiDB Introduction - Boston MySQL Meetup Group
TiDB Introduction - Boston MySQL Meetup Group
Ā
TiDB Introduction - San Francisco MySQL Meetup
TiDB Introduction - San Francisco MySQL Meetup
Ā
TiDB Introduction
TiDB Introduction
Ā
MySQL Server Defaults
MySQL Server Defaults
Ā
MySQL Cloud Service Deep Dive
MySQL Cloud Service Deep Dive
Ā
MySQL 5.7 + JSON
MySQL 5.7 + JSON
Ā
Using MySQL in Automated Testing
Using MySQL in Automated Testing
Ā
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7
Ā
MySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
Ā
MySQL For Linux Sysadmins
MySQL For Linux Sysadmins
Ā
MySQL: From Single Instance to Big Data
MySQL: From Single Instance to Big Data
Ā
MySQL NoSQL APIs
MySQL NoSQL APIs
Ā
MySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics Improvements
Ā
The InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQL
Ā
My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2
Ā
Recently uploaded
EY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
Neo4j
Ā
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
aditisharan08
Ā
What is Binary Language? Computer Number Systems
What is Binary Language? Computer Number Systems
JheuzeDellosa
Ā
Call Girls In Mukherjee Nagar š± 9999965857 š¤© Delhi š«¦ HOT AND SEXY VVIP š SE...
Call Girls In Mukherjee Nagar š± 9999965857 š¤© Delhi š«¦ HOT AND SEXY VVIP š SE...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
Ā
Russian Call Girls in Karol Bagh Aasnvi ā”ļø 8264348440 šš Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ā”ļø 8264348440 šš Independent Escort S...
soniya singh
Ā
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Christina Lin
Ā
DNT_Corporate presentation know about us
DNT_Corporate presentation know about us
Dynamic Netsoft
Ā
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
Power Karaoke
Ā
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Alberto GonzƔlez Trastoy
Ā
Call Girls in Naraina Delhi šÆCall Us š8264348440š
Call Girls in Naraina Delhi šÆCall Us š8264348440š
soniya singh
Ā
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
AxelRicardoTrocheRiq
Ā
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
kalichargn70th171
Ā
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
VICTOR MAESTRE RAMIREZ
Ā
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
OPEN KNOWLEDGE GmbH
Ā
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
Wave PLM
Ā
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
kaushalgiri8080
Ā
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
ICS
Ā
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
BradBedford3
Ā
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
bodapatigopi8531
Ā
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
Wave PLM
Ā
Recently uploaded
(20)
EY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
Ā
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
Ā
What is Binary Language? Computer Number Systems
What is Binary Language? Computer Number Systems
Ā
Call Girls In Mukherjee Nagar š± 9999965857 š¤© Delhi š«¦ HOT AND SEXY VVIP š SE...
Call Girls In Mukherjee Nagar š± 9999965857 š¤© Delhi š«¦ HOT AND SEXY VVIP š SE...
Ā
Russian Call Girls in Karol Bagh Aasnvi ā”ļø 8264348440 šš Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ā”ļø 8264348440 šš Independent Escort S...
Ā
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Ā
DNT_Corporate presentation know about us
DNT_Corporate presentation know about us
Ā
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
Ā
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Ā
Call Girls in Naraina Delhi šÆCall Us š8264348440š
Call Girls in Naraina Delhi šÆCall Us š8264348440š
Ā
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
Ā
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
Ā
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
Ā
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
Ā
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
Ā
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
Ā
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
Ā
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Ā
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
Ā
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
Ā
MySQL Query Optimization
1.
2.
Query Optimization Morgan
Tocker MySQL Community Manager October, 2014 Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. |
3.
Safe Harbor Statement
The following 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. Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 3
4.
Copyright Ā© 2014
Oracle and/or its affiliates. All rights reserved. | 4 Todayās Agenda Introduction World Schema IMDB Schema Advanced Topics 1 2 3 4
5.
Copyright Ā© 2014
Oracle and/or its affiliates. All rights reserved. | Introduction ā¢ SQL is declarative. ā¢ You say what you want, not how to process. ā¢ Canāt sight check a query to understand how it executes. ā¢ Database management chooses the best possible way -Āā think like a GPS navigator. 5
6.
Copyright Ā© 2014
Oracle and/or its affiliates. All rights reserved. | GPS Software 6
7.
MySQL Optimizer Copyright
Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 7
8.
Diagnostic Commands Copyright
Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ EXPLAIN (all versions) ā¢ EXPLAIN FORMAT=JSON (MySQL 5.6+) ā¢ Workbench supports visual format. ā¢ OPTIMIZER TRACE (MySQL 5.6+) 8
9.
Copyright Ā© 2014
Oracle and/or its affiliates. All rights reserved. | 9 Todayās Agenda Introduction World Schema IMDB Schema Advanced Topics 1 2 3 4
10.
The World Schema
Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ Contains cities, countries and language statistics. ā¢ Download From: ā¢ http://dev.mysql.com/doc/index-Āāother.html ā¢ Very small data set -Āā good for learning. ā¢ Not perfect for explaining performance differences 10
11.
Find Countries in
Asia with Population >5M Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 11 mysql> EXPLAIN SELECT * FROM Country WHERE Continent = 'Asia' AND population > 5000000G ********************** 1. row ********************** id: 1 select_type: SIMPLE table: Country partitions: NULL type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 239 filtered: 4.76 Extra: Using where 1 row in set, 1 warning (0.00 sec)
12.
Copyright Ā© 2014
Oracle and/or its affiliates. All rights reserved. | 12 EXPLAIN: { "query_block": { "select_id": 1, "cost_info": { "query_cost": "53.80" }, "table": { "table_name": "Country", "access_type": "ALL", "rows_examined_per_scan": 239, "rows_produced_per_join": 11, "filtered": 4.7614, "cost_info": { "read_cost": "51.52", "eval_cost": "2.28", "prefix_cost": "53.80", "data_read_per_join": "2K" }, "used_columns": [ "Code", .. "Capital", "Code2" ], "attached_condition": "((`world`.`country`.`Continent` = 'Asia') and (`world`.`country`.`Population` > 5000000))" } } } FORMAT=JSON Available since MySQL 5.6. Expanded in 5.7 to add cost information.
13.
What indexes will
make this query faster? Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ Some suggestions: ā¢ Index on (population) ā¢ Index on (continent) ā¢ Index on (population, continent) ā¢ Index on (continent, population) 13 SELECT * FROM Country WHERE Continent = 'Asia' AND population > 5000000;
14.
Copyright Ā© 2014
Oracle and/or its affiliates. All rights reserved. | Next Question ā¢ Given so many choices, which is the best choice? ā¢ A good GPS navigator understands traffic and finds the fastest route. ā¢ A good query optimizer does similar. 14
15.
Query Optimizer Strategy
Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ Pick the plan that consumes the least amount of resources (CPU, IO). 15
16.
Query Optimizer Strategy
(cont.) Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ Use statistics available to identify good and bad plans. ā¢ Decisions may include: ā¢ Which indexes are good/bad. ā¢ Which order to join tables in. ā¢ If indexes should be read in a particular order to avoid sorting, or if sorting is not expensive. 16
17.
Using single column
indexes firstā¦. Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ p (population) ā¢ c (continent) 17
18.
mysql> ALTER TABLE
Country ADD INDEX p (population); Query OK, 0 rows affected (0.04 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> EXPLAIN SELECT * FROM Country WHERE Continent = 'Asia' AND population > 5000000G ************************ 1. row ************************ Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 18 id: 1 select_type: SIMPLE table: Country partitions: NULL type: ALL possible_keys: p key: NULL key_len: NULL ref: NULL rows: 239 filtered: 6.46 Extra: Using where 1 row in set, 1 warning (0.00 sec)
19.
Why would an
index not be used? Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 19 mysql> EXPLAIN FORMAT=JSON SELECT * FROM Country FORCE INDEX (p) WHERE Continent = 'Asia' AND population > 5000000G ******* 1. row ******* EXPLAIN: { "query_block": { "select_id": 1, "cost_info": { "query_cost": "152.21" }, "table": { "table_name": "Country", "access_type": "range", "possible_keys": [ "p" ], Using MySQL 5.7+ mysql> EXPLAIN FORMAT=JSON SELECT * FROM Country WHERE Continent = 'Asia' AND population > 5000000G ******* 1. row ******* EXPLAIN: { "query_block": { "select_id": 1, "cost_info": { "query_cost": "53.80" }, "table": { "table_name": "Country", "access_type": "ALL", "possible_keys": [ "p" ],
20.
Modifying the query
range: >50M Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 20 mysql> EXPLAIN SELECT * FROM Country WHERE Continent = 'Asia' AND population > 50000000G ********************** 1. row ********************** id: 1 select_type: SIMPLE table: Country partitions: NULL type: range possible_keys: p key: p key_len: 4 ref: NULL rows: 24 filtered: 14.29 Extra: Using index condition; Using where 1 row in set, 1 warning (0.00 sec)
21.
mysql> ALTER TABLE
Country ADD INDEX c (continent); Query OK, 0 rows affected (0.04 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> EXPLAIN SELECT * FROM Country WHERE Continent = 'Asia' AND population > 5000000G *********************** 1. row *********************** Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 21 id: 1 select_type: SIMPLE table: Country partitions: NULL type: ref possible_keys: p,c key: c key_len: 1 ref: const rows: 51 filtered: 45.19 Extra: Using where 1 row in set, 1 warning (0.00 sec)
22.
Modifying the query
range: >500M mysql> EXPLAIN SELECT * FROM Country WHERE Continent = 'Asia' AND population > 500000000G ********************** 1. row ********************** Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 22 id: 1 select_type: SIMPLE table: Country partitions: NULL type: range possible_keys: p,c key: p key_len: 4 ref: NULL rows: 2 filtered: 21.34 Extra: Using index condition; Using where 1 row in set, 1 warning (0.00 sec)
23.
Composite Indexes Copyright
Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ On >50M which is better? ā¢ (population, continent) ā¢ (continent, population) 23
24.
mysql> ALTER TABLE
Country ADD INDEX pc (pop..on, co..nt); Query OK, 0 rows affected (0.02 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> EXPLAIN SELECT * FROM Country WHERE Continent = 'Asia' AND population > 50000000G ********************** 1. row ********************** Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 24 id: 1 select_type: SIMPLE table: Country partitions: NULL type: ref possible_keys: p,c,pc key: c key_len: 1 ref: const rows: 51 filtered: 10.04 Extra: Using where 1 row in set, 1 warning (0.00 sec)
25.
FORCE INDEX mysql>
EXPLAIN SELECT * FROM Country FORCE INDEX (pc) WHERE Continent = 'Asia' AND population > 50000000G ********************** 1. row ********************** Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 25 id: 1 select_type: SIMPLE table: Country partitions: NULL type: range possible_keys: pc key: pc key_len: 4 ref: NULL rows: 24 filtered: 14.29 Extra: Using index condition 1 row in set, 1 warning (0.00 sec)
26.
mysql> EXPLAIN FORMAT=JSON
SELECT * FROM Country FORCE INDEX (pc) WHERE Continent = 'Asia' AND population > 50000000G ********************** 1. row ********************** EXPLAIN: { "query_block": { "select_id": 1, "cost_info": { "query_cost": "34.61" }, "table": { Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 26 .. ], "key": "pc", "used_key_parts": [ "Population" ], .. Easier to see with JSON EXPLAIN
27.
Copyright Ā© 2014
Oracle and/or its affiliates. All rights reserved. | Rule of Thumb ā¢ Index on (const, range) instead of (range, const). ā¢ Applies to all databases. 27
28.
mysql> ALTER TABLE
Country ADD INDEX cp (co..nt, pop..on); Query OK, 0 rows affected (0.02 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> EXPLAIN SELECT * FROM Country WHERE Continent = 'Asia' AND population > 50000000G ********************** 1. row ********************** Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 28 id: 1 select_type: SIMPLE table: Country partitions: NULL type: range possible_keys: p,c,pc,cp key: cp key_len: 5 ref: NULL rows: 11 filtered: 100.00 Extra: Using index condition 1 row in set, 1 warning (0.00 sec)
29.
Where Population >N.
Lower is better. Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | Cost Estimates 29 5M 50M 500M Table Scan 53.80 53.80 53.80 (Population) 152.21 34.61 3.81 (Continent) 28.20 28.20 28.20 (Population, 152.21 34.61 3.81 Continent) (Continent, Population) 24.83 16.41 3.81
30.
Copyright Ā© 2014
Oracle and/or its affiliates. All rights reserved. | 30 Todayās Agenda Introduction World Schema IMDB Schema Advanced Topics 1 2 3 4
31.
Examples Using IMDB
Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ Larger than world database schema. ā¢ Better to understand performance differences. ā¢ License requires data to be regenerated: ā¢ http://imdbpy.sourceforge.net/ 31
32.
mysql> EXPLAIN SELECT
* FROM title WHERE title = 'The Lion King'G ********************** 1. row ********************** Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 32 id: 1 select_type: SIMPLE table: title partitions: NULL type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 2387523 filtered: 0.50 Extra: Using where 1 row in set, 1 warning (0.00 sec) Ignore EXPLAIN time Actual run time is 2.9 seconds (Not shown)
33.
mysql> ALTER TABLE
title ADD INDEX (title(100)); Query OK, 0 rows affected (4.73 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> EXPLAIN SELECT * FROM title WHERE title = 'The Lion King'G ********************** 1. row ********************** Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 33 id: 1 select_type: SIMPLE table: title partitions: NULL type: ref possible_keys: title key: title key_len: 102 ref: const rows: 4 filtered: 100.00 Extra: Using where 1 row in set, 1 warning (0.01 sec) From 2.9 seconds to 0.0 seconds (!!!)
34.
How does LIKE
work? Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 34 mysql> EXPLAIN SELECT * FROM title WHERE title LIKE 'The Lion %'G ********************** 1. row ********************** id: 1 select_type: SIMPLE table: title partitions: NULL type: range possible_keys: title key: title key_len: 102 ref: NULL rows: 109 filtered: 100.00 Extra: Using where 1 row in set, 1 warning (0.01 sec)
35.
Copyright Ā© 2014
Oracle and/or its affiliates. All rights reserved. | LIKE (cont.) 35 mysql> EXPLAIN SELECT * FROM title WHERE title LIKE 'The%'G ********************** 1. row ********************** id: 1 select_type: SIMPLE table: title partitions: NULL type: range possible_keys: title key: title key_len: 102 ref: NULL rows: 325548 filtered: 100.00 Extra: Using where 1 row in set, 1 warning (0.00 sec) VS Very Close. Estimate is that it is almost as fast to table scan. Run Time is 1.9 sec
36.
Copyright Ā© 2014
Oracle and/or its affiliates. All rights reserved. | Sorting 36 mysql> EXPLAIN SELECT * FROM title WHERE title = 'The Lion King' ORDER BY production_yearG ********************** 1. row ********************** id: 1 select_type: SIMPLE table: title partitions: NULL type: ref possible_keys: title key: title key_len: 102 ref: const rows: 4 filtered: 100.00 Extra: Using where; Using filesort 1 row in set, 1 warning (0.00 sec)
37.
SELECT movie_info.* FROM
title INNER JOIN movie_info ON title.id=movie_info.movie_id WHERE title=āThe Lion KingāG ********************** 1. row ********************** Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 37 id: 1 select_type: SIMPLE table: movie_info type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 1212187 Extra: NULL ********************** 2. row ********************** id: 1 select_type: SIMPLE table: title type: eq_ref possible_keys: PRIMARY,title key: PRIMARY key_len: 4 ref: imdb.movie_info.movie_id rows: 1 Extra: Using where
38.
mysql> ALTER TABLE
movie_info ADD INDEX mi (movie_id); Query OK, 0 rows affected (1.95 sec) Records: 0 Duplicates: 0 Warnings: 0 Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 38
39.
EXPLAIN SELECT movie_info.*
FROM title INNER .. WHERE title='The Lion King'G ********************** 1. row ********************** Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 39 id: 1 select_type: SIMPLE table: title type: ref possible_keys: PRIMARY,title key: title key_len: 102 ref: const rows: 4 Extra: Using where ********************** 2. row ********************** id: 1 select_type: SIMPLE table: movie_info type: ref possible_keys: mi key: mi key_len: 4 ref: imdb.title.id rows: 7 Extra: NULL
40.
mysql> EXPLAIN SELECT
* FROM movie_info WHERE movie_id IN (SELECT id FROM title WHERE title = 'The Lion King')G ********************** 1. row ********************** Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 40 id: 1 select_type: SIMPLE table: title type: ref possible_keys: PRIMARY,title key: title key_len: 102 ref: const rows: 4 Extra: Using where ********************** 2. row ********************** id: 1 select_type: SIMPLE table: movie_info type: ref possible_keys: mi key: mi key_len: 4 ref: imdb.title.id rows: 7 Extra: NULL
41.
Copyright Ā© 2014
Oracle and/or its affiliates. All rights reserved. | 41 Todayās Agenda Introduction World Schema IMDB Schema Advanced Topics 1 2 3 4
42.
Optimizer Hints Copyright
Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ USE INDEX ā¢ FORCE INDEX ā¢ IGNORE INDEX ā¢ STRAIGHT JOIN 42
43.
Optimizer Hints (cont.)
Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 43 Expanded in MySQL 5.6 mysql> select @@optimizer_switchG ********************** 1. row ********************** @@optimizer_switch: index_merge=on,index_merge_union=on,index_merge_sort_union =on,index_merge_intersection=on,engine_condition_pushdown= on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,bl ock_nested_loop=on,batched_key_access=off,materialization= on,semijoin=on,loosescan=on,firstmatch=on,subquery_materia lization_cost_based=on,use_index_extensions=on,condition_f anout_filter=on 1 row in set (0.00 sec)
44.
Statistics Sampling Copyright
Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ Some decisions based on pre-Āācomputed statistics. ā¢ For example, which order to join tables. ā¢ Accuracy of statistics greatly improved in MySQL 5.6. ā¢ Feature is called āInnoDB persistent statisticsā. 44
45.
Optimizer Decision Visibility
Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ Intended for MySQL developer usage, and reporting optimizer bugs. ā¢ Yet totally practical for advanced usage :) 45 New to MySQL 5.6 SET optimizer_trace="enabled=on"; SELECT /* query here */; SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
46.
Optimizer Trace Output
ā¢ Includes why decisions were not made: Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | 46 .. "index": "pc", "ranges": [ "50000000 < Population" ], "index_dives_for_eq_ranges": true, "rowid_ordered": false, "using_mrr": false, "index_only": false, "rows": 24, "cost": 29.81, "chosen": false, "cause": "cost" },
47.
Too many indexes
Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ Slows down modifications due to maintenance cost. ā¢ i.e. Slower INSERT/UPDATE/DELETE ā¢ May also lead to worse decisions being made by optimizer. ā¢ Too many similar choices. ā¢ Only limited time window to evaluate suitability. ā¢ Space requirements in memory and storage. 47
48.
MySQL 5.7 and
beyond Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ We are working on a new cost model. ā¢ Better adapt to new hardware with different costs (i.e. SSDs have cheap random IO). ā¢ Memory buffer aware cost estimates. 48
49.
Cost constants configurable
per engine in 5.7 Copyright Ā© 2014 Oracle and/or its affiliates. All rights reserved. | ā¢ Previously hard-Āācoded constants. ā¢ Better adapts to differences in hardware. 49
50.
Copyright Ā© 2014
Oracle and/or its affiliates. All rights reserved. | 50
Download now