Skip to main content

MySQL High Performance Tuning Guide

2h 49m 22s
English
Paid

Master MySQL Performance Tuning and learn to prevent potential performance pitfalls. Discover how MySQL optimizes and executes queries efficiently for a high-performance database experience.

Understanding MySQL Architecture

  • Explore the steps involved in Query Execution.
  • Learn how the Client/Server Protocol influences MySQL.
  • Gain insights into the workings of the Query Optimizer.
  • Understand the unique role of the Storage Engine Layer in MySQL.

Identifying Queries for Optimization

  • Utilize the Performance Schema to identify optimization opportunities by analyzing time consumption.
  • Focus on the most impactful queries instead of the top 1000, which might not be worth optimizing.
  • Extract meaningful insights from the extensive performance views and metrics available in MySQL.
  • Recognize that UPDATE and DELETE statements impact I/O and response time due to their read operations.

Efficient Query Analysis

  • Understand the importance of a query plan for each request.
  • Learn to interpret query plans and the function of each node type in MySQL.
  • Use examples to demonstrate how the EXPLAIN output highlights query performance issues.
  • Identify key indicators that point to performance bottlenecks.

The Clustered Index and Primary Key Selection

  • Understand the impact of primary index choice on MySQL's index-organized tables.
  • See how the primary key affects I/O patterns, secondary index sizes, and buffer pool loading.
  • Learn why an optimal primary key should be compact, sequentially increasing, and efficiently organized.

Indexing for Performance Success

  • Explore the primary functions of an index for optimizing queries.
  • Distinguish which tables benefit from indexing and which do not.
  • Understand how MySQL utilizes statistics to select the best index and how you can influence its decisions.

Optimizing with Composite Indexes

  • Avoid common mistakes when using composite indexes.
  • Determine the optimal column order for multicolumn indexes.
  • Make informed decisions about index selection based on understanding rather than general rules.
  • Recognize when Redundant Indexes can be beneficial and when to avoid them.
  • Conduct benchmarks to quantify performance improvements.

Configuring MySQL Server for Optimal Performance

  • Adopt best practices for implementing MySQL configuration changes for tuning.
  • Identify three configuration options that may benefit from non-default values and learn how to optimize them.
  • Review the data lifecycle in InnoDB to inform configuration decisions.
  • Adjust critical parameters for specific use-cases, such as buffer pool instances and parallel execution.

MySQL Transactions and Lock Management

  • Ensure data integrity with transactions, while minimizing performance impacts.
  • Understand why locks are necessary and explore ways to reduce their negative effects.
  • Leverage indexes, transaction splitting, and isolation levels to decrease lock contention.
  • Utilize monitoring tools and reporting tables to identify and troubleshoot lock issues.

Scaling MySQL for Growth

  • Explore the concept of scaling MySQL and the various dimensions involved in scaling.
  • Learn strategies for scaling different types of loads effectively.
  • Implement Replication, utilize Read-Pools, conduct Health Checks, and engage in Service Discovery.
  • Identify key considerations and challenges in Sharding the database.
  • Discover benefits and scenarios for Partitioning data in MySQL.
  • Evaluate the use cases and advantages of using a Queue.
  • Understand fundamental principles for scaling writes with sharding solutions.

About the Author: udemy

udemy thumbnail
By connecting students all over the world to the best instructors, Udemy is helping individuals reach their goals and pursue their dreams. Udemy is the leading global marketplace for teaching and learning, connecting millions of students to the skills they need to succeed. Udemy helps organizations of all kinds prepare for the ever-evolving future of work. Our curated collection of top-rated business and technical courses gives companies, governments, and nonprofits the power to develop in-house expertise and satisfy employees’ hunger for learning and development.

Watch Online 70 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 70 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Query Execution Basics
All Course Lessons (70)
#Lesson TitleDurationAccess
1
Query Execution Basics Demo
02:02
2
Utility Layer
02:33
3
SQL Layer
04:26
4
Storage Engine Layer
02:03
5
Conclusions
00:30
6
Making use of Performance Schema
04:11
7
Top 10 Time-Consuming Queries
03:33
8
Why Are Queries Slow?
01:30
9
Finding Candidate Queries for Optimization
02:37
10
Table I/O and File I/O for Selects
01:45
11
Table I/O and File I/O for Updates and Deletes
03:34
12
The Error Summary Tables
01:41
13
Conclusions
00:37
14
How does the Optimiser work?
02:12
15
EXPLAIN basics
01:34
16
Example 1: Single Table, Table Scan
02:36
17
EXPLAIN ANALYZE
01:13
18
Example 2: Single Table, Index Access
00:43
19
Example 3: Multicolumn Index
00:59
20
Example 4: Two Tables With Subquery And Sorting
01:55
21
Spotting jumps in runtime
04:42
22
Hot and cold cache behaviour
00:51
23
Conclusions
00:39
24
Section Overview
00:53
25
The Clustered Indexes
01:02
26
Choosing a Good Primary Key
03:44
27
Use Case: Inserting rows in primary key order with InnoDB
05:04
28
Optimal Primary Key in Practice
01:42
29
Introduction
04:37
30
Why add a Secondary Index?
03:47
31
When should you Add or Remove Indexes?
02:14
32
Why Index Statistics are Important?
02:07
33
How to help MySQL make better decisions?
04:22
34
Covering Indexes
03:38
35
Motivation
01:52
36
Columns Order
02:00
37
Composite Index Hands-on
05:07
38
Using Redundant Indexes
04:53
39
Composite Indexes Extra Remarks
01:52
40
Conclusions
00:31
41
Configuration Best Practices
04:44
42
InnoDB Overview
02:56
43
Adjusting the Buffer Pool Size
03:49
44
Adding more Buffer Pool Instances
02:06
45
Why Dumping the Buffer Pool?
01:09
46
Tuning Flushing Pages Process
02:47
47
Tuning Redo Log Buffer
01:51
48
Tuning Redo Log Files
03:03
49
Parallel Query Execution
01:29
50
Adjusting the Query Buffers
02:00
51
Conclusions
00:56
52
Impact of Transactions
01:07
53
Managing Locks
03:45
54
Purpose of Undo Logs
02:22
55
Reduce Locking - Transaction size and age
02:02
56
Reduce Locking - Indexes
01:48
57
Reduce Locking - Transaction Isolation Levels
03:51
58
Monitoring Transactions
01:46
59
Monitoring Locks
00:48
60
Conclusions
00:58
61
Scaling MySQL Intro
00:50
62
Read Versus Write Loads
02:31
63
Replication - Scaling Reads with Read Pools
03:38
64
Replication - Service Discovery for Read Pools
02:23
65
Queuing
02:36
66
Sharding Introduction
03:28
67
Sharding Concerns
04:06
68
How to Partition Data in MySQL
03:16
69
Multiple Partitioning Keys
01:57
70
Querying Across Shards
01:29
Unlock unlimited learning

Get instant access to all 69 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription