SlideShare a Scribd company logo
1 of 46
Download to read offline
Modern Query Optimisation
Features In MySQL 8


Karthik P R
CEO, Mydbops
Apr 24, 2021
Mydbops Webinar
Interested in Open Source Database technologies
11 Years of Experience with MySQL
Ex-Yahoo!
Tech Speaker/ Blogger 
CEO Mydbops
Karthik P R 
About Me
Database
Consulting
Services
Managed
Database
Services
Focuses on Top Opensource database MySQL,MariaDB,
MongoDB and PostgreSQL ON Premises and Cloud
Mydbops Services
MySQL 8 (A Major Leap)
Indexing features
Execution Plan Improvements
Optimiser Imporvements
Others Improvements
Agenda
MySQL 8 is a Major Leap
MySQL 8 is a Major Leap
MySQL 8
InnoDB Performance Enhancement
Faster Parallel Replication
Security Enhancements
Operational Improvements ( Shell,Clone Plugin )
CTE , Window Function and Lateral Derived tables
Indexing Features
Indexing Features
Functional Index
Descending Index
Invisible Index
Functional Index
Functional Index
MySQL do Support Functional Index 8.0.13
A functional key part of queries can be indexed
JSON based Queries benefits a lot
Functional Index ( Before )
EXPLAIN SELECT VERSION,TILE FROM NODES_BACKUP WHERE DATE(TIMESTAMP)='2021-04-04';

+----+-------------+--------------+------------+------+---------------+------+---------+------+----------+----------+-------------+

| ID | SELECT_TYPE | TABLE | PARTITIONS | TYPE | POSSIBLE_KEYS | KEY | KEY_LEN | REF | ROWS | FILTERED | EXTRA |

+----+-------------+--------------+------------+------+---------------+------+---------+------+----------+----------+-------------+

| 1 | SIMPLE | NODES_BACKUP | NULL | ALL | NULL | NULL | NULL | NULL | 47378283 | 100.00 | USING WHERE |

+----+-------------+--------------+------------+------+---------------+------+---------+------+----------+----------+-------------+

ROWS SCANNED	 : 47M
TYPE	 	 : FULL TABLE SCAN
Functional Index ( Possible Solutions )
Query Rewrites
	 Application Rewrites
Rewriter Plugin
ProxySQL Rewrites
Virtual Column ( Again needs a Rewrite )
Functional Index ( After )
CREATE INDEX IDX_FUN_DATE ON NODES_BACKUP((DATE(TIMESTAMP)))

QUERY OK, 0 ROWS AFFECTED (5 MIN 30.38 SEC)

RECORDS: 0 DUPLICATES: 0 WARNINGS: 0

SELECT VERSION,TILE FROM NODES_BACKUP WHERE DATE(TIMESTAMP)='2021-04-04';

+----+-------------+--------------+------------+------+---------------+--------------+---------+-------+------+----------+-------+

| ID | SELECT_TYPE | TABLE | PARTITIONS | TYPE | POSSIBLE_KEYS | KEY | KEY_LEN | REF | ROWS | FILTERED | EXTRA |

+----+-------------+--------------+------------+------+---------------+--------------+---------+-------+------+----------+-------+

| 1 | SIMPLE | NODES_BACKUP | NULL | REF | IDX_FUN_DATE | IDX_FUN_DATE | 4 | CONST | 423 | 100.00 | NULL |

+----+-------------+--------------+------------+------+---------------+--------------+---------+-------+------+----------+-------+

1 ROW IN SET, 1 WARNING (0.01 SEC)
Descending Index
Descending Index
MySQL do Support Functional Index 8.0
B+Tree Indexing ( InnoDB )
Index are generally Forward Scan
Queries with different sorting orders are benefited a lot
ASC / DESC Keywords must be used while indexing
Idenitify the queries for optimisation via "Backward index scan" in Extra
filed.
Descending Index
EXPLAIN SELECT EMAIL,DESCRIPTION FROM USERS ORDER BY CREATION_TIME DESC ,DISPLAY_NAME DESC LIMIT 10;

+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+

| ID | SELECT_TYPE | TABLE | PARTITIONS | TYPE | POSSIBLE_KEYS | KEY | KEY_LEN | REF | ROWS | FILTERED | EXTRA |

+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+

| 1 | SIMPLE | USERS | NULL | ALL | NULL | NULL | NULL | NULL | 3941 | 100.00 | USING FILESORT |

+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+

CREATE INDEX IDX_CT_DN ON USERS(CREATION_TIME,DISPLAY_NAME);

QUERY OK, 0 ROWS AFFECTED (0.03 SEC)

EXPLAIN SELECT EMAIL,DESCRIPTION FROM USERS ORDER BY CREATION_TIME DESC ,DISPLAY_NAME DESC LIMIT 10;

+----+-------------+-------+------------+-------+---------------+-----------+---------+------+------+----------+---------------------+

| ID | SELECT_TYPE | TABLE | PARTITIONS | TYPE | POSSIBLE_KEYS | KEY | KEY_LEN | REF | ROWS | FILTERED | EXTRA |

+----+-------------+-------+------------+-------+---------------+-----------+---------+------+------+----------+---------------------+

| 1 | SIMPLE | USERS | NULL | INDEX | NULL | IDX_CT_DN | 772 | NULL | 10 | 100.00 | BACKWARD INDEX SCAN |

+----+-------------+-------+------------+-------+---------------+-----------+---------+------+------+----------+---------------------+
Descending Index
Query uses the Composite Index ( Creation Time , Display name )
No ordering is mentioned in while Indexing
Query uses Backward Scan ( Explain Plan )
But Forwards scan will have 15% Performance gain
Descending Index
CREATE INDEX IDX_CT_DN_DESC ON USERS(CREATION_TIME DESC,DISPLAY_NAME DESC);

QUERY OK, 0 ROWS AFFECTED (0.03 SEC)

RECORDS: 0 DUPLICATES: 0 WARNINGS: 0

EXPLAIN SELECT EMAIL,DESCRIPTION FROM USERS ORDER BY CREATION_TIME DESC ,DISPLAY_NAME DESC LIMIT 10;

+----+-------------+-------+------------+-------+---------------+----------------+---------+------+------+----------+-------+

| ID | SELECT_TYPE | TABLE | PARTITIONS | TYPE | POSSIBLE_KEYS | KEY | KEY_LEN | REF | ROWS | FILTERED | EXTRA |

+----+-------------+-------+------------+-------+---------------+----------------+---------+------+------+----------+-------+

| 1 | SIMPLE | USERS | NULL | INDEX | NULL | IDX_CT_DN_DESC | 772 | NULL | 10 | 100.00 | NULL |

+----+-------------+-------+------------+-------+---------------+----------------+---------+------+------+----------+-------+
Descending Index ( Limitation )
Only Supports InnoDB Engine
Full text is not supported
They are not Buffered in Change Buffer
Invisible Index
Indexing for Performance ( Process followed Before )
Find the Query for optimisation
Create the index ( Affects Optimiser )
Evaluate the Query Performane
Retain the Index if it benefits queries
Drop the Index if it is not much benefit
Indexing for Performance ( After )
Note : Can be followed for dropping an unused index too.
Find the Query for optimisation
Create the index using Invisible as Keyword
Turn on Switch 'use_invisible-indexes=on' ( session )
Evaluate the Query Performane now.
Make the index Visible if it benefits.
Drop the Index if it is not much benefit.
Execution Plan Improvements
Execution Plan Improvements
Explain Format in Tree
Explain Analyze
Explain Format=Tree
Explain Format=Tree
Explain Format in Tree was introduced in MySQL 8.0.16
Shows Query Plans and Cost estimations
Easy understanding on internal operations
Identation helps understanding the execution orders
Explain ( Traditional / Tabular )
explain SELECT 'node' as type, node_id as id FROM node_tags WHERE k='bridge' and v='memorial' UNION SELECT 'way' as type, way_id as id FROM
way_tags WHERE k='lanes' and v='cafe' UNION SELECT 'relation' as type, relation_id as id FROM relation_tags WHERE k='tunnel' and
v='Barkingside';
+----+--------------+---------------+------------+------+---------------+------+---------+------+---------+----------+-----------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+--------------+---------------+------------+------+---------------+------+---------+------+---------+----------+-----------------+
| 1 | PRIMARY | node_tags | NULL | ALL | NULL | NULL | NULL | NULL | 822783 | 1.00 | Using where |
| 2 | UNION | way_tags | NULL | ALL | NULL | NULL | NULL | NULL | 1347360 | 1.00 | Using where |
| 3 | UNION | relation_tags | NULL | ALL | NULL | NULL | NULL | NULL | 62797 | 1.00 | Using where |
|NULL| UNION RESULT | <union1,2,3> | NULL | ALL | NULL | NULL | NULL | NULL | NULL | NULL | Using temporary |
+----+--------------+---------------+------------+------+---------------+------+---------+------+---------+----------+-----------------+
Explain Format=Tree
explain format=tree SELECT 'node' as type, node_id as id FROM node_tags WHERE k='bridge' and v='memorial' UNION SELECT 'way' as type, way_id
as id FROM
way_tags WHERE k='lanes' and v='cafe' UNION SELECT 'relation' as type, relation_id as id FROM relation_tags WHERE k='tunnel' and
v='Barkingside'G
*************************** 1. row ***************************
EXPLAIN: -> Table scan on <union temporary> (cost=0.01..281.61 rows=22329)
-> Union materialize with deduplication (cost=227556.45..227838.05 rows=22329)
-> Filter: ((node_tags.k = 'bridge') and (node_tags.v = 'memorial')) (cost=83072.55 rows=8228)
-> Table scan on node_tags (cost=83072.55 rows=822783)
-> Filter: ((way_tags.k = 'lanes') and (way_tags.v = 'cafe')) (cost=135899.00 rows=13474)
-> Table scan on way_tags (cost=135899.00 rows=1347360)
-> Filter: ((relation_tags.k = 'tunnel') and (relation_tags.v = 'Barkingside')) (cost=6351.95 rows=628)
-> Table scan on relation_tags (cost=6351.95 rows=62797)
Explain Analyze
Explain Analyze
Explain Analyse was introduced in MySQL 8.0.18
Actual Time spent on each Iterator.
Time to fetch first row
Time to fetch all rows
Better than Optimiser Trace
Explain Analyze
explain analyze SELECT 'node' as type, node_id as id FROM node_tags WHERE k='bridge' and v='memorial' UNION SELECT 'way' as type, way_id as
id FROM way_tags WHERE k='lanes' and v='cafe' UNION SELECT 'relation' as type, relation_id as id FROM relation_tags WHERE k='tunnel' and
v='Barkingside'G
*************************** 1. row ***************************
EXPLAIN: -> Table scan on <union temporary> (cost=0.01..281.61 rows=22329) (actual time=0.002..0.002 rows=0 loops=1)
-> Union materialize with deduplication (cost=227556.45..227838.05 rows=22329) (actual time=636.728..636.728 rows=0 loops=1)
-> Filter: ((node_tags.k = 'bridge') and (node_tags.v = 'memorial')) (cost=83072.55 rows=8228) (actual time=233.393..233.393 rows=0
loops=1)
-> Table scan on node_tags (cost=83072.55 rows=822783) (actual time=0.039..182.413 rows=833423 loops=1)
-> Filter: ((way_tags.k = 'lanes') and (way_tags.v = 'cafe')) (cost=135899.00 rows=13474) (actual time=385.278..385.278 rows=0
loops=1)
-> Table scan on way_tags (cost=135899.00 rows=1347360) (actual time=0.039..299.565 rows=1343477 loops=1)
-> Filter: ((relation_tags.k = 'tunnel') and (relation_tags.v = 'Barkingside')) (cost=6351.95 rows=628) (actual time=18.046..18.046
rows=0 loops=1)
-> Table scan on relation_tags (cost=6351.95 rows=62797) (actual time=0.039..14.101 rows=63220 loops=1)
Explain Analyze
Explain Tree ( Cost ) Analyze (time in ms)
Primary 83072 233
UNION 135899 385
UNION 6352 18
 UNION Result 227556  636 
Note : Analyze result is 15-30% slower than actual time
Optimiser Improvements
Optimiser Improvements
Optimiser is the brain of any RDBMS , better algorithms and better statistics will
make its intelligence better.
Histogram
Hash Joins
Histogram
Histogram
Syntax :
analyze table table_name update/drop histogram with N buckets ;
The Data distribution is not uniform
Histogram helps in Better stat to DB.
MySQL has Histogram from 8.0.3 ( before GA )
Histogram can be applied for single column / multi columns.
Histogram
Title
0
500
1,000
1,500
2,000
2,500
3,000
3,500
4,000
0 1​ 2​
​
series1
Count value
1 1 0
2 3874 1
3 116 2
Data Distribution
Histogram (Before)
Optimizer Guesstimate the row filtering is common
Histogram (After)
Row filtering has improved post Histogram
Histogram
Histograms are better than indexes at cases.
Lesser maintenance over head.
Controlled by condition_fanout_filter.
1024 is the maximum buckets allowed.
Histogram stats for table can be visualised on
COLUMN_STATISTICS ( IS table ).
Hash Join
Optimiser Improvements
Hash Join
MySQL Support Hash Join from 8.0.18
Improved further in 8.0.20 ( Left Join )
HASH Join algorithm help in better Join Optimisation than BNL.
Equi Joins are much benefitted
BNL Support was removed from MySQL 8.0.20
Hash Join
In memory Hash table
Join Buffer Size Prevents over flow
Optimiser switch hash_join=ON (can't be disabled )
Other Optimisation
	 	 	 Perfer_orderding_index
	 	 	 sub_query_to-derived
CTE ( Common Table expression )
Lateral Derived Tables
Window Function
Switches
Reach Us : Info@mydbops.com
Thank You

More Related Content

What's hot

ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdfProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdfJesmar Cannao'
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsMydbops
 
MySQL 5.7が魅せる新しい運用の形
MySQL 5.7が魅せる新しい運用の形MySQL 5.7が魅せる新しい運用の形
MySQL 5.7が魅せる新しい運用の形yoku0825
 
Handling Schema Changes Using pt-online-schema change.
Handling Schema Changes Using pt-online-schema change.Handling Schema Changes Using pt-online-schema change.
Handling Schema Changes Using pt-online-schema change.Mydbops
 
Optimizing queries MySQL
Optimizing queries MySQLOptimizing queries MySQL
Optimizing queries MySQLGeorgi Sotirov
 
MySQL topology healing at OLA.
MySQL topology healing at OLA.MySQL topology healing at OLA.
MySQL topology healing at OLA.Mydbops
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterKenny Gryp
 
MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼NeoClova
 
How to use histograms to get better performance
How to use histograms to get better performanceHow to use histograms to get better performance
How to use histograms to get better performanceMariaDB plc
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialJean-François Gagné
 
MySQL Performance for DevOps
MySQL Performance for DevOpsMySQL Performance for DevOps
MySQL Performance for DevOpsSveta Smirnova
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseSeveralnines
 
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 Performanceoysteing
 
MySQL Timeout Variables Explained
MySQL Timeout Variables Explained MySQL Timeout Variables Explained
MySQL Timeout Variables Explained Mydbops
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)Altinity Ltd
 
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11Kenny Gryp
 
The MySQL Query Optimizer Explained Through Optimizer Trace
The MySQL Query Optimizer Explained Through Optimizer TraceThe MySQL Query Optimizer Explained Through Optimizer Trace
The MySQL Query Optimizer Explained Through Optimizer Traceoysteing
 
MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바NeoClova
 
MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8Frederic Descamps
 

What's hot (20)

ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdfProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient Backups
 
MySQL 5.7が魅せる新しい運用の形
MySQL 5.7が魅せる新しい運用の形MySQL 5.7が魅せる新しい運用の形
MySQL 5.7が魅せる新しい運用の形
 
Handling Schema Changes Using pt-online-schema change.
Handling Schema Changes Using pt-online-schema change.Handling Schema Changes Using pt-online-schema change.
Handling Schema Changes Using pt-online-schema change.
 
Query logging with proxysql
Query logging with proxysqlQuery logging with proxysql
Query logging with proxysql
 
Optimizing queries MySQL
Optimizing queries MySQLOptimizing queries MySQL
Optimizing queries MySQL
 
MySQL topology healing at OLA.
MySQL topology healing at OLA.MySQL topology healing at OLA.
MySQL topology healing at OLA.
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
 
MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼
 
How to use histograms to get better performance
How to use histograms to get better performanceHow to use histograms to get better performance
How to use histograms to get better performance
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
 
MySQL Performance for DevOps
MySQL Performance for DevOpsMySQL Performance for DevOps
MySQL Performance for DevOps
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash Course
 
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
 
MySQL Timeout Variables Explained
MySQL Timeout Variables Explained MySQL Timeout Variables Explained
MySQL Timeout Variables Explained
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
 
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
 
The MySQL Query Optimizer Explained Through Optimizer Trace
The MySQL Query Optimizer Explained Through Optimizer TraceThe MySQL Query Optimizer Explained Through Optimizer Trace
The MySQL Query Optimizer Explained Through Optimizer Trace
 
MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바
 
MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8
 

Similar to Modern query optimisation features in MySQL 8.

New optimizer features in MariaDB releases before 10.12
New optimizer features in MariaDB releases before 10.12New optimizer features in MariaDB releases before 10.12
New optimizer features in MariaDB releases before 10.12Sergey Petrunya
 
MySQL 5.7 Tutorial Dutch PHP Conference 2015
MySQL 5.7 Tutorial Dutch PHP Conference 2015MySQL 5.7 Tutorial Dutch PHP Conference 2015
MySQL 5.7 Tutorial Dutch PHP Conference 2015Dave Stokes
 
MySQL 5.7. Tutorial - Dutch PHP Conference 2015
MySQL 5.7. Tutorial - Dutch PHP Conference 2015MySQL 5.7. Tutorial - Dutch PHP Conference 2015
MySQL 5.7. Tutorial - Dutch PHP Conference 2015Dave Stokes
 
Applied Partitioning And Scaling Your Database System Presentation
Applied Partitioning And Scaling Your Database System PresentationApplied Partitioning And Scaling Your Database System Presentation
Applied Partitioning And Scaling Your Database System PresentationRichard Crowley
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeWim Godden
 
Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQLJussi Pohjolainen
 
Parallel Query in AWS Aurora MySQL
Parallel Query in AWS Aurora MySQLParallel Query in AWS Aurora MySQL
Parallel Query in AWS Aurora MySQLMydbops
 
Oracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatOracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatFranck Pachot
 
MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...
MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...
MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...Alkin Tezuysal
 
MySQL Cookbook: Recipes for Developers
MySQL Cookbook: Recipes for DevelopersMySQL Cookbook: Recipes for Developers
MySQL Cookbook: Recipes for DevelopersSveta Smirnova
 
The Current State of Table API in 2022
The Current State of Table API in 2022The Current State of Table API in 2022
The Current State of Table API in 2022Flink Forward
 
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)Valeriy Kravchuk
 
Need for Speed: MySQL Indexing
Need for Speed: MySQL IndexingNeed for Speed: MySQL Indexing
Need for Speed: MySQL IndexingMYXPLAIN
 
4. Data Manipulation.ppt
4. Data Manipulation.ppt4. Data Manipulation.ppt
4. Data Manipulation.pptKISHOYIANKISH
 
Top 10 tips for Oracle performance
Top 10 tips for Oracle performanceTop 10 tips for Oracle performance
Top 10 tips for Oracle performanceGuy Harrison
 
Window functions in MariaDB 10.2
Window functions in MariaDB 10.2Window functions in MariaDB 10.2
Window functions in MariaDB 10.2Sergey Petrunya
 
BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7Georgi Kodinov
 

Similar to Modern query optimisation features in MySQL 8. (20)

New optimizer features in MariaDB releases before 10.12
New optimizer features in MariaDB releases before 10.12New optimizer features in MariaDB releases before 10.12
New optimizer features in MariaDB releases before 10.12
 
MySQL 5.7 Tutorial Dutch PHP Conference 2015
MySQL 5.7 Tutorial Dutch PHP Conference 2015MySQL 5.7 Tutorial Dutch PHP Conference 2015
MySQL 5.7 Tutorial Dutch PHP Conference 2015
 
MySQL 5.7. Tutorial - Dutch PHP Conference 2015
MySQL 5.7. Tutorial - Dutch PHP Conference 2015MySQL 5.7. Tutorial - Dutch PHP Conference 2015
MySQL 5.7. Tutorial - Dutch PHP Conference 2015
 
Applied Partitioning And Scaling Your Database System Presentation
Applied Partitioning And Scaling Your Database System PresentationApplied Partitioning And Scaling Your Database System Presentation
Applied Partitioning And Scaling Your Database System Presentation
 
MySQL SQL Tutorial
MySQL SQL TutorialMySQL SQL Tutorial
MySQL SQL Tutorial
 
Explain
ExplainExplain
Explain
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQL
 
Parallel Query in AWS Aurora MySQL
Parallel Query in AWS Aurora MySQLParallel Query in AWS Aurora MySQL
Parallel Query in AWS Aurora MySQL
 
Oracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatOracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor format
 
MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...
MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...
MySQL Cookbook: Recipes for Developers, Alkin Tezuysal and Sveta Smirnova - P...
 
MySQL Cookbook: Recipes for Developers
MySQL Cookbook: Recipes for DevelopersMySQL Cookbook: Recipes for Developers
MySQL Cookbook: Recipes for Developers
 
The Current State of Table API in 2022
The Current State of Table API in 2022The Current State of Table API in 2022
The Current State of Table API in 2022
 
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)
 
Need for Speed: MySQL Indexing
Need for Speed: MySQL IndexingNeed for Speed: MySQL Indexing
Need for Speed: MySQL Indexing
 
4. Data Manipulation.ppt
4. Data Manipulation.ppt4. Data Manipulation.ppt
4. Data Manipulation.ppt
 
Do You Know The 11g Plan?
Do You Know The 11g Plan?Do You Know The 11g Plan?
Do You Know The 11g Plan?
 
Top 10 tips for Oracle performance
Top 10 tips for Oracle performanceTop 10 tips for Oracle performance
Top 10 tips for Oracle performance
 
Window functions in MariaDB 10.2
Window functions in MariaDB 10.2Window functions in MariaDB 10.2
Window functions in MariaDB 10.2
 
BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7
 

More from Mydbops

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024Mydbops
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Mydbops
 
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMydbops
 
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Mydbops
 
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15Mydbops
 
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventData-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventMydbops
 
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...Mydbops
 
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Mydbops
 
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mydbops
 
Data Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLData Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLMydbops
 
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsNavigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsMydbops
 
Data High Availability With TIDB
Data High Availability With TIDBData High Availability With TIDB
Data High Availability With TIDBMydbops
 
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mydbops
 
Enhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesEnhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesMydbops
 
Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Mydbops
 
Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Mydbops
 
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsTiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsMydbops
 
Achieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLAchieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLMydbops
 
Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding Mydbops
 

More from Mydbops (20)

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
 
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
 
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
 
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
 
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventData-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
 
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
 
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
 
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
 
Data Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLData Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQL
 
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsNavigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
 
Data High Availability With TIDB
Data High Availability With TIDBData High Availability With TIDB
Data High Availability With TIDB
 
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
 
Enhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesEnhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificates
 
Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops
 
Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops
 
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsTiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
 
Achieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLAchieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQL
 
Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding
 

Recently uploaded

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
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 FMESafe Software
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 

Recently uploaded (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Modern query optimisation features in MySQL 8.

  • 1. Modern Query Optimisation Features In MySQL 8 Karthik P R CEO, Mydbops Apr 24, 2021 Mydbops Webinar
  • 2. Interested in Open Source Database technologies 11 Years of Experience with MySQL Ex-Yahoo! Tech Speaker/ Blogger  CEO Mydbops Karthik P R  About Me
  • 3. Database Consulting Services Managed Database Services Focuses on Top Opensource database MySQL,MariaDB, MongoDB and PostgreSQL ON Premises and Cloud Mydbops Services
  • 4. MySQL 8 (A Major Leap) Indexing features Execution Plan Improvements Optimiser Imporvements Others Improvements Agenda
  • 5. MySQL 8 is a Major Leap
  • 6. MySQL 8 is a Major Leap MySQL 8 InnoDB Performance Enhancement Faster Parallel Replication Security Enhancements Operational Improvements ( Shell,Clone Plugin ) CTE , Window Function and Lateral Derived tables
  • 10. Functional Index MySQL do Support Functional Index 8.0.13 A functional key part of queries can be indexed JSON based Queries benefits a lot
  • 11. Functional Index ( Before ) EXPLAIN SELECT VERSION,TILE FROM NODES_BACKUP WHERE DATE(TIMESTAMP)='2021-04-04'; +----+-------------+--------------+------------+------+---------------+------+---------+------+----------+----------+-------------+ | ID | SELECT_TYPE | TABLE | PARTITIONS | TYPE | POSSIBLE_KEYS | KEY | KEY_LEN | REF | ROWS | FILTERED | EXTRA | +----+-------------+--------------+------------+------+---------------+------+---------+------+----------+----------+-------------+ | 1 | SIMPLE | NODES_BACKUP | NULL | ALL | NULL | NULL | NULL | NULL | 47378283 | 100.00 | USING WHERE | +----+-------------+--------------+------------+------+---------------+------+---------+------+----------+----------+-------------+ ROWS SCANNED : 47M TYPE : FULL TABLE SCAN
  • 12. Functional Index ( Possible Solutions ) Query Rewrites Application Rewrites Rewriter Plugin ProxySQL Rewrites Virtual Column ( Again needs a Rewrite )
  • 13. Functional Index ( After ) CREATE INDEX IDX_FUN_DATE ON NODES_BACKUP((DATE(TIMESTAMP))) QUERY OK, 0 ROWS AFFECTED (5 MIN 30.38 SEC) RECORDS: 0 DUPLICATES: 0 WARNINGS: 0 SELECT VERSION,TILE FROM NODES_BACKUP WHERE DATE(TIMESTAMP)='2021-04-04'; +----+-------------+--------------+------------+------+---------------+--------------+---------+-------+------+----------+-------+ | ID | SELECT_TYPE | TABLE | PARTITIONS | TYPE | POSSIBLE_KEYS | KEY | KEY_LEN | REF | ROWS | FILTERED | EXTRA | +----+-------------+--------------+------------+------+---------------+--------------+---------+-------+------+----------+-------+ | 1 | SIMPLE | NODES_BACKUP | NULL | REF | IDX_FUN_DATE | IDX_FUN_DATE | 4 | CONST | 423 | 100.00 | NULL | +----+-------------+--------------+------------+------+---------------+--------------+---------+-------+------+----------+-------+ 1 ROW IN SET, 1 WARNING (0.01 SEC)
  • 15. Descending Index MySQL do Support Functional Index 8.0 B+Tree Indexing ( InnoDB ) Index are generally Forward Scan Queries with different sorting orders are benefited a lot ASC / DESC Keywords must be used while indexing Idenitify the queries for optimisation via "Backward index scan" in Extra filed.
  • 16. Descending Index EXPLAIN SELECT EMAIL,DESCRIPTION FROM USERS ORDER BY CREATION_TIME DESC ,DISPLAY_NAME DESC LIMIT 10; +----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+ | ID | SELECT_TYPE | TABLE | PARTITIONS | TYPE | POSSIBLE_KEYS | KEY | KEY_LEN | REF | ROWS | FILTERED | EXTRA | +----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+ | 1 | SIMPLE | USERS | NULL | ALL | NULL | NULL | NULL | NULL | 3941 | 100.00 | USING FILESORT | +----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+ CREATE INDEX IDX_CT_DN ON USERS(CREATION_TIME,DISPLAY_NAME); QUERY OK, 0 ROWS AFFECTED (0.03 SEC) EXPLAIN SELECT EMAIL,DESCRIPTION FROM USERS ORDER BY CREATION_TIME DESC ,DISPLAY_NAME DESC LIMIT 10; +----+-------------+-------+------------+-------+---------------+-----------+---------+------+------+----------+---------------------+ | ID | SELECT_TYPE | TABLE | PARTITIONS | TYPE | POSSIBLE_KEYS | KEY | KEY_LEN | REF | ROWS | FILTERED | EXTRA | +----+-------------+-------+------------+-------+---------------+-----------+---------+------+------+----------+---------------------+ | 1 | SIMPLE | USERS | NULL | INDEX | NULL | IDX_CT_DN | 772 | NULL | 10 | 100.00 | BACKWARD INDEX SCAN | +----+-------------+-------+------------+-------+---------------+-----------+---------+------+------+----------+---------------------+
  • 17. Descending Index Query uses the Composite Index ( Creation Time , Display name ) No ordering is mentioned in while Indexing Query uses Backward Scan ( Explain Plan ) But Forwards scan will have 15% Performance gain
  • 18. Descending Index CREATE INDEX IDX_CT_DN_DESC ON USERS(CREATION_TIME DESC,DISPLAY_NAME DESC); QUERY OK, 0 ROWS AFFECTED (0.03 SEC) RECORDS: 0 DUPLICATES: 0 WARNINGS: 0 EXPLAIN SELECT EMAIL,DESCRIPTION FROM USERS ORDER BY CREATION_TIME DESC ,DISPLAY_NAME DESC LIMIT 10; +----+-------------+-------+------------+-------+---------------+----------------+---------+------+------+----------+-------+ | ID | SELECT_TYPE | TABLE | PARTITIONS | TYPE | POSSIBLE_KEYS | KEY | KEY_LEN | REF | ROWS | FILTERED | EXTRA | +----+-------------+-------+------------+-------+---------------+----------------+---------+------+------+----------+-------+ | 1 | SIMPLE | USERS | NULL | INDEX | NULL | IDX_CT_DN_DESC | 772 | NULL | 10 | 100.00 | NULL | +----+-------------+-------+------------+-------+---------------+----------------+---------+------+------+----------+-------+
  • 19. Descending Index ( Limitation ) Only Supports InnoDB Engine Full text is not supported They are not Buffered in Change Buffer
  • 21. Indexing for Performance ( Process followed Before ) Find the Query for optimisation Create the index ( Affects Optimiser ) Evaluate the Query Performane Retain the Index if it benefits queries Drop the Index if it is not much benefit
  • 22. Indexing for Performance ( After ) Note : Can be followed for dropping an unused index too. Find the Query for optimisation Create the index using Invisible as Keyword Turn on Switch 'use_invisible-indexes=on' ( session ) Evaluate the Query Performane now. Make the index Visible if it benefits. Drop the Index if it is not much benefit.
  • 24. Execution Plan Improvements Explain Format in Tree Explain Analyze
  • 26. Explain Format=Tree Explain Format in Tree was introduced in MySQL 8.0.16 Shows Query Plans and Cost estimations Easy understanding on internal operations Identation helps understanding the execution orders
  • 27. Explain ( Traditional / Tabular ) explain SELECT 'node' as type, node_id as id FROM node_tags WHERE k='bridge' and v='memorial' UNION SELECT 'way' as type, way_id as id FROM way_tags WHERE k='lanes' and v='cafe' UNION SELECT 'relation' as type, relation_id as id FROM relation_tags WHERE k='tunnel' and v='Barkingside'; +----+--------------+---------------+------------+------+---------------+------+---------+------+---------+----------+-----------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+--------------+---------------+------------+------+---------------+------+---------+------+---------+----------+-----------------+ | 1 | PRIMARY | node_tags | NULL | ALL | NULL | NULL | NULL | NULL | 822783 | 1.00 | Using where | | 2 | UNION | way_tags | NULL | ALL | NULL | NULL | NULL | NULL | 1347360 | 1.00 | Using where | | 3 | UNION | relation_tags | NULL | ALL | NULL | NULL | NULL | NULL | 62797 | 1.00 | Using where | |NULL| UNION RESULT | <union1,2,3> | NULL | ALL | NULL | NULL | NULL | NULL | NULL | NULL | Using temporary | +----+--------------+---------------+------------+------+---------------+------+---------+------+---------+----------+-----------------+
  • 28. Explain Format=Tree explain format=tree SELECT 'node' as type, node_id as id FROM node_tags WHERE k='bridge' and v='memorial' UNION SELECT 'way' as type, way_id as id FROM way_tags WHERE k='lanes' and v='cafe' UNION SELECT 'relation' as type, relation_id as id FROM relation_tags WHERE k='tunnel' and v='Barkingside'G *************************** 1. row *************************** EXPLAIN: -> Table scan on <union temporary> (cost=0.01..281.61 rows=22329) -> Union materialize with deduplication (cost=227556.45..227838.05 rows=22329) -> Filter: ((node_tags.k = 'bridge') and (node_tags.v = 'memorial')) (cost=83072.55 rows=8228) -> Table scan on node_tags (cost=83072.55 rows=822783) -> Filter: ((way_tags.k = 'lanes') and (way_tags.v = 'cafe')) (cost=135899.00 rows=13474) -> Table scan on way_tags (cost=135899.00 rows=1347360) -> Filter: ((relation_tags.k = 'tunnel') and (relation_tags.v = 'Barkingside')) (cost=6351.95 rows=628) -> Table scan on relation_tags (cost=6351.95 rows=62797)
  • 30. Explain Analyze Explain Analyse was introduced in MySQL 8.0.18 Actual Time spent on each Iterator. Time to fetch first row Time to fetch all rows Better than Optimiser Trace
  • 31. Explain Analyze explain analyze SELECT 'node' as type, node_id as id FROM node_tags WHERE k='bridge' and v='memorial' UNION SELECT 'way' as type, way_id as id FROM way_tags WHERE k='lanes' and v='cafe' UNION SELECT 'relation' as type, relation_id as id FROM relation_tags WHERE k='tunnel' and v='Barkingside'G *************************** 1. row *************************** EXPLAIN: -> Table scan on <union temporary> (cost=0.01..281.61 rows=22329) (actual time=0.002..0.002 rows=0 loops=1) -> Union materialize with deduplication (cost=227556.45..227838.05 rows=22329) (actual time=636.728..636.728 rows=0 loops=1) -> Filter: ((node_tags.k = 'bridge') and (node_tags.v = 'memorial')) (cost=83072.55 rows=8228) (actual time=233.393..233.393 rows=0 loops=1) -> Table scan on node_tags (cost=83072.55 rows=822783) (actual time=0.039..182.413 rows=833423 loops=1) -> Filter: ((way_tags.k = 'lanes') and (way_tags.v = 'cafe')) (cost=135899.00 rows=13474) (actual time=385.278..385.278 rows=0 loops=1) -> Table scan on way_tags (cost=135899.00 rows=1347360) (actual time=0.039..299.565 rows=1343477 loops=1) -> Filter: ((relation_tags.k = 'tunnel') and (relation_tags.v = 'Barkingside')) (cost=6351.95 rows=628) (actual time=18.046..18.046 rows=0 loops=1) -> Table scan on relation_tags (cost=6351.95 rows=62797) (actual time=0.039..14.101 rows=63220 loops=1)
  • 32. Explain Analyze Explain Tree ( Cost ) Analyze (time in ms) Primary 83072 233 UNION 135899 385 UNION 6352 18  UNION Result 227556  636  Note : Analyze result is 15-30% slower than actual time
  • 34. Optimiser Improvements Optimiser is the brain of any RDBMS , better algorithms and better statistics will make its intelligence better. Histogram Hash Joins
  • 36. Histogram Syntax : analyze table table_name update/drop histogram with N buckets ; The Data distribution is not uniform Histogram helps in Better stat to DB. MySQL has Histogram from 8.0.3 ( before GA ) Histogram can be applied for single column / multi columns.
  • 38. Histogram (Before) Optimizer Guesstimate the row filtering is common
  • 39. Histogram (After) Row filtering has improved post Histogram
  • 40. Histogram Histograms are better than indexes at cases. Lesser maintenance over head. Controlled by condition_fanout_filter. 1024 is the maximum buckets allowed. Histogram stats for table can be visualised on COLUMN_STATISTICS ( IS table ).
  • 43. Hash Join MySQL Support Hash Join from 8.0.18 Improved further in 8.0.20 ( Left Join ) HASH Join algorithm help in better Join Optimisation than BNL. Equi Joins are much benefitted BNL Support was removed from MySQL 8.0.20
  • 44. Hash Join In memory Hash table Join Buffer Size Prevents over flow Optimiser switch hash_join=ON (can't be disabled )
  • 45. Other Optimisation Perfer_orderding_index sub_query_to-derived CTE ( Common Table expression ) Lateral Derived Tables Window Function Switches
  • 46. Reach Us : Info@mydbops.com Thank You