SlideShare ist ein Scribd-Unternehmen logo
1 von 9
Downloaden Sie, um offline zu lesen
DBAHire.com 
Query 
Optimization 
With 
MySQL 
5.7 
and 
MariaDB 
10: 
Even 
Newer 
Tricks 
Query Optimization With MySQL 5.7 
and MariaDB 10: Even Newer Tricks 
© 
2014 
DBAHIRE.COM 
Percona Live London 2014 
dbahire.com/pluk14 
1
Query 
Optimization 
With 
MySQL 
5.7 
and 
MariaDB 
10: 
Even 
Newer 
Tricks 
© 
2014 
DBAHIRE.COM 
Agenda - 3 hours 
2 
1. Introduction 8. Subquery Optimization 
2. Break (VM installation) 9. Fulltext Search 
3. General Optimizer Improvements 10. GIS Improvements 
4. Computed/Virtual Columns 11. Break 
5. Query Rewrite Plugins 12. Query Profiling 
6. SQL Mode Changes 13. Results and Conclusions 
7. JOIN Optimization 14. Q&A
Query 
Optimization 
With 
MySQL 
5.7 
and 
MariaDB 
10: 
Even 
Newer 
Tricks 
Query Optimization With MySQL 5.7 and MariaDB 10: 
Even Newer Tricks 
INTRODUCTION 
© 
2014 
DBAHIRE.COM 
3
Query 
Optimization 
With 
MySQL 
5.7 
and 
MariaDB 
10: 
Even 
Newer 
Tricks 
This is Me Fighting Bad Query Performance 
© 
2014 
DBAHIRE.COM 
• MySQL Consultant at 
DBAHire.com 
• Used to work for Oracle 
(MySQL), Percona 
• Loves MySQL query 
optimization and HA 
4
Query 
Optimization 
With 
MySQL 
5.7 
and 
MariaDB 
10: 
Even 
Newer 
Tricks 
© 
2014 
DBAHIRE.COM 
MySQL Versions 
• Oracle MySQL 5.6 (GA) almost 2 years old 
• MariaDB 10 over 7 months old 
• Several lab/alpha releases of MySQL 5.7 and 
MariaDB 10.1 with great new features 
– We will focus only on SQL-related ones 
– We will not perform formal benchmarks or comparisons 
5
Query 
Optimization 
With 
MySQL 
5.7 
and 
MariaDB 
10: 
Even 
Newer 
Tricks 
New Query Optimization Features 
• Index Condition Pushdown 
• Subquery Optimizations 
(materialization and semijoin) 
• IN-to-EXISTS 
• JOIN-to-WHERE 
• Multi-Range Read 
• Batched Key Access 
• Persistent InnoDB Statistics 
• EXPLAIN FORMAT=JSON 
• EXPLAIN INSERT/UPDATE/DELETE 
• Hash Join 
• New cost-based optimizer 
• Optimizer Trace 
• Filesort with a short LIMIT 
© 
2014 
DBAHIRE.COM 
• EXISTS-to-IN 
• EXPLAIN FOR CONNECTION 
• Faster eq_ref 
• Extended secondary keys 
• Histograms 
• Improved Spatial Indexes (GIS) 
• Histograms 
• Virtual columns 
• PERFORMANCE_SCHEMA 
improvements 
• Forced strict SQL mode; functional 
dependencies in GROUP BY 
• Query rewrite plugin 
• Configurable optimizer_search_depth 
6
Query 
Optimization 
With 
MySQL 
5.7 
and 
MariaDB 
10: 
Even 
Newer 
Tricks 
I Already Mentioned Some of Those Topics 
© 
2014 
DBAHIRE.COM 
One Year Ago 
• Check my presentation here: 
http://www.slideshare.net/jynus/query-optimization56 
7
Query 
Optimization 
With 
MySQL 
5.7 
and 
MariaDB 
10: 
Even 
Newer 
Tricks 
© 
2014 
DBAHIRE.COM 
Example Application 
• OSM Database is licensed under the Open 
DataBase License and is Copyright 
OpenStreetMap Contributors 
8
Query 
Optimization 
With 
MySQL 
5.7 
and 
MariaDB 
10: 
Even 
Newer 
Tricks 
100+ slides at Percona Live London 2014 
© 
2014 
DBAHIRE.COM 
You still have time to attend 
Percona Live London 2014 and my 
tutorial on Query Optimization 
Go to http://www.percona.com/ 
live/london-2014/ and register for 
tutorial day! 
9

Weitere ähnliche Inhalte

Andere mochten auch

Mysql query optimization
Mysql query optimizationMysql query optimization
Mysql query optimization
Baohua Cai
 
MySQL Query Optimization (Basics)
MySQL Query Optimization (Basics)MySQL Query Optimization (Basics)
MySQL Query Optimization (Basics)
Karthik .P.R
 
MySQL Query And Index Tuning
MySQL Query And Index TuningMySQL Query And Index Tuning
MySQL Query And Index Tuning
Manikanda kumar
 

Andere mochten auch (18)

Mysql query optimization
Mysql query optimizationMysql query optimization
Mysql query optimization
 
Query Optimization with MySQL 5.6: Old and New Tricks
Query Optimization with MySQL 5.6: Old and New TricksQuery Optimization with MySQL 5.6: Old and New Tricks
Query Optimization with MySQL 5.6: Old and New Tricks
 
Tunning sql query
Tunning sql queryTunning sql query
Tunning sql query
 
MySQL Query tuning 101
MySQL Query tuning 101MySQL Query tuning 101
MySQL Query tuning 101
 
Advanced MySQL Query and Schema Tuning
Advanced MySQL Query and Schema TuningAdvanced MySQL Query and Schema Tuning
Advanced MySQL Query and Schema Tuning
 
MySQL Query Optimization
MySQL Query OptimizationMySQL Query Optimization
MySQL Query Optimization
 
My sql optimization
My sql optimizationMy sql optimization
My sql optimization
 
Webinar 2013 advanced_query_tuning
Webinar 2013 advanced_query_tuningWebinar 2013 advanced_query_tuning
Webinar 2013 advanced_query_tuning
 
MySQL Query Optimization.
MySQL Query Optimization.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 2013Query 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
 
Query Optimization with MySQL 5.7 and MariaDB 10: Even newer tricks
Query Optimization with MySQL 5.7 and MariaDB 10: Even newer tricksQuery Optimization with MySQL 5.7 and MariaDB 10: Even newer tricks
Query Optimization with MySQL 5.7 and MariaDB 10: Even newer tricks
 
MySQL Query Optimization (Basics)
MySQL Query Optimization (Basics)MySQL Query Optimization (Basics)
MySQL Query Optimization (Basics)
 
Sql query patterns, optimized
Sql query patterns, optimizedSql query patterns, optimized
Sql query patterns, optimized
 
MySQL Query And Index Tuning
MySQL Query And Index TuningMySQL Query And Index Tuning
MySQL Query And Index Tuning
 
Percona Live 2012PPT: MySQL Query optimization
Percona Live 2012PPT: MySQL Query optimizationPercona Live 2012PPT: MySQL Query optimization
Percona Live 2012PPT: MySQL Query optimization
 
How to Design Indexes, Really
How to Design Indexes, ReallyHow to Design Indexes, Really
How to Design Indexes, Really
 
Mastering MySQL/Query
Mastering MySQL/QueryMastering MySQL/Query
Mastering MySQL/Query
 
Using Optimizer Hints to Improve MySQL Query Performance
Using Optimizer Hints to Improve MySQL Query PerformanceUsing Optimizer Hints to Improve MySQL Query Performance
Using Optimizer Hints to Improve MySQL Query Performance
 

Mehr von Jaime Crespo

Software libre para gestión de proyectos
Software libre para gestión de proyectosSoftware libre para gestión de proyectos
Software libre para gestión de proyectos
Jaime Crespo
 
warptalk: Experiencia de usuario y usabilidad
warptalk: Experiencia de usuario y usabilidadwarptalk: Experiencia de usuario y usabilidad
warptalk: Experiencia de usuario y usabilidad
Jaime Crespo
 

Mehr von Jaime Crespo (12)

Haciendo copias de seguridad de todo el conocimiento humano con python y soft...
Haciendo copias de seguridad de todo el conocimiento humano con python y soft...Haciendo copias de seguridad de todo el conocimiento humano con python y soft...
Haciendo copias de seguridad de todo el conocimiento humano con python y soft...
 
Backing up Wikipedia Databases
Backing up Wikipedia DatabasesBacking up Wikipedia Databases
Backing up Wikipedia Databases
 
Query Optimization with MySQL 8.0 and MariaDB 10.3: The Basics
Query Optimization with MySQL 8.0 and MariaDB 10.3: The BasicsQuery Optimization with MySQL 8.0 and MariaDB 10.3: The Basics
Query Optimization with MySQL 8.0 and MariaDB 10.3: The Basics
 
Wikipedia Burgos devfest 2017
Wikipedia Burgos devfest 2017Wikipedia Burgos devfest 2017
Wikipedia Burgos devfest 2017
 
Scaling and hardware provisioning for databases (lessons learned at wikipedia)
Scaling and hardware provisioning for databases (lessons learned at wikipedia)Scaling and hardware provisioning for databases (lessons learned at wikipedia)
Scaling and hardware provisioning for databases (lessons learned at wikipedia)
 
MySQL Schema Design in Practice
MySQL Schema Design in PracticeMySQL Schema Design in Practice
MySQL Schema Design in Practice
 
MySQL at Wikipedia: How we do relational data at the Wikimedia Foundation
MySQL at Wikipedia: How we do relational data at the Wikimedia FoundationMySQL at Wikipedia: How we do relational data at the Wikimedia Foundation
MySQL at Wikipedia: How we do relational data at the Wikimedia Foundation
 
Query optimization: from 0 to 10 (and up to 5.7)
Query optimization: from 0 to 10 (and up to 5.7)Query optimization: from 0 to 10 (and up to 5.7)
Query optimization: from 0 to 10 (and up to 5.7)
 
Why MySQL
Why MySQLWhy MySQL
Why MySQL
 
MySQL GUI Administration
MySQL GUI AdministrationMySQL GUI Administration
MySQL GUI Administration
 
Software libre para gestión de proyectos
Software libre para gestión de proyectosSoftware libre para gestión de proyectos
Software libre para gestión de proyectos
 
warptalk: Experiencia de usuario y usabilidad
warptalk: Experiencia de usuario y usabilidadwarptalk: Experiencia de usuario y usabilidad
warptalk: Experiencia de usuario y usabilidad
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Teaser For the Percona Live London 2014 Tutorial: "Query Optimization with MySQL 5.7 and MariaDB 10: even newer tricks" by DBAHire.com

  • 1. DBAHire.com Query Optimization With MySQL 5.7 and MariaDB 10: Even Newer Tricks Query Optimization With MySQL 5.7 and MariaDB 10: Even Newer Tricks © 2014 DBAHIRE.COM Percona Live London 2014 dbahire.com/pluk14 1
  • 2. Query Optimization With MySQL 5.7 and MariaDB 10: Even Newer Tricks © 2014 DBAHIRE.COM Agenda - 3 hours 2 1. Introduction 8. Subquery Optimization 2. Break (VM installation) 9. Fulltext Search 3. General Optimizer Improvements 10. GIS Improvements 4. Computed/Virtual Columns 11. Break 5. Query Rewrite Plugins 12. Query Profiling 6. SQL Mode Changes 13. Results and Conclusions 7. JOIN Optimization 14. Q&A
  • 3. Query Optimization With MySQL 5.7 and MariaDB 10: Even Newer Tricks Query Optimization With MySQL 5.7 and MariaDB 10: Even Newer Tricks INTRODUCTION © 2014 DBAHIRE.COM 3
  • 4. Query Optimization With MySQL 5.7 and MariaDB 10: Even Newer Tricks This is Me Fighting Bad Query Performance © 2014 DBAHIRE.COM • MySQL Consultant at DBAHire.com • Used to work for Oracle (MySQL), Percona • Loves MySQL query optimization and HA 4
  • 5. Query Optimization With MySQL 5.7 and MariaDB 10: Even Newer Tricks © 2014 DBAHIRE.COM MySQL Versions • Oracle MySQL 5.6 (GA) almost 2 years old • MariaDB 10 over 7 months old • Several lab/alpha releases of MySQL 5.7 and MariaDB 10.1 with great new features – We will focus only on SQL-related ones – We will not perform formal benchmarks or comparisons 5
  • 6. Query Optimization With MySQL 5.7 and MariaDB 10: Even Newer Tricks New Query Optimization Features • Index Condition Pushdown • Subquery Optimizations (materialization and semijoin) • IN-to-EXISTS • JOIN-to-WHERE • Multi-Range Read • Batched Key Access • Persistent InnoDB Statistics • EXPLAIN FORMAT=JSON • EXPLAIN INSERT/UPDATE/DELETE • Hash Join • New cost-based optimizer • Optimizer Trace • Filesort with a short LIMIT © 2014 DBAHIRE.COM • EXISTS-to-IN • EXPLAIN FOR CONNECTION • Faster eq_ref • Extended secondary keys • Histograms • Improved Spatial Indexes (GIS) • Histograms • Virtual columns • PERFORMANCE_SCHEMA improvements • Forced strict SQL mode; functional dependencies in GROUP BY • Query rewrite plugin • Configurable optimizer_search_depth 6
  • 7. Query Optimization With MySQL 5.7 and MariaDB 10: Even Newer Tricks I Already Mentioned Some of Those Topics © 2014 DBAHIRE.COM One Year Ago • Check my presentation here: http://www.slideshare.net/jynus/query-optimization56 7
  • 8. Query Optimization With MySQL 5.7 and MariaDB 10: Even Newer Tricks © 2014 DBAHIRE.COM Example Application • OSM Database is licensed under the Open DataBase License and is Copyright OpenStreetMap Contributors 8
  • 9. Query Optimization With MySQL 5.7 and MariaDB 10: Even Newer Tricks 100+ slides at Percona Live London 2014 © 2014 DBAHIRE.COM You still have time to attend Percona Live London 2014 and my tutorial on Query Optimization Go to http://www.percona.com/ live/london-2014/ and register for tutorial day! 9