Foreword |
|
xiii | |
Preface |
|
xv | |
|
|
1 | (18) |
|
MySQL's Logical Architecture |
|
|
1 | (1) |
|
Connection Management and Security |
|
|
2 | (1) |
|
Optimization and Execution |
|
|
3 | (1) |
|
|
3 | (1) |
|
|
4 | (1) |
|
|
4 | (2) |
|
|
6 | (2) |
|
|
8 | (1) |
|
|
9 | (1) |
|
|
10 | (1) |
|
|
11 | (2) |
|
Multiversion Concurrency Control |
|
|
13 | (2) |
|
|
15 | (1) |
|
|
16 | (1) |
|
|
16 | (1) |
|
|
17 | (1) |
|
|
17 | (1) |
|
|
18 | (1) |
|
|
18 | (1) |
|
2 Monitoring in a Reliability Engineering World |
|
|
19 | (22) |
|
The Impact of Reliability Engineering on DBA Teams |
|
|
20 | (1) |
|
Defining Service Level Goals |
|
|
20 | (2) |
|
What Does It Take to Make Customers Happy? |
|
|
22 | (1) |
|
|
23 | (1) |
|
|
23 | (1) |
|
|
24 | (1) |
|
|
25 | (2) |
|
|
27 | (1) |
|
|
27 | (2) |
|
|
29 | (7) |
|
Measuring Long-Term Performance |
|
|
36 | (1) |
|
Learning Your Business Cadence |
|
|
36 | (1) |
|
Tracking Your Metrics Effectively |
|
|
37 | (1) |
|
Using Monitoring Tools to Inspect the Performance |
|
|
37 | (1) |
|
Using SLOs to Guide Your Overall Architecture |
|
|
38 | (1) |
|
|
39 | (2) |
|
|
41 | (34) |
|
Introduction to Performance Schema |
|
|
41 | (1) |
|
|
42 | (2) |
|
|
44 | (1) |
|
|
45 | (1) |
|
|
46 | (1) |
|
|
46 | (1) |
|
|
46 | (2) |
|
|
48 | (1) |
|
Enabling and Disabling Performance Schema |
|
|
48 | (1) |
|
Enabling and Disabling Instruments |
|
|
48 | (2) |
|
Enabling and Disabling Consumers |
|
|
50 | (1) |
|
Tuning Monitoring for Specific Objects |
|
|
51 | (1) |
|
Tuning Threads Monitoring |
|
|
51 | (1) |
|
Adjusting Memory Size for Performance Schema |
|
|
52 | (1) |
|
|
53 | (1) |
|
|
53 | (1) |
|
|
53 | (9) |
|
Examining Read Versus Write Performance |
|
|
62 | (1) |
|
|
63 | (1) |
|
|
64 | (2) |
|
|
66 | (4) |
|
Examining Most Frequent Errors |
|
|
70 | (1) |
|
Examining Performance Schema Itself |
|
|
71 | (2) |
|
|
73 | (2) |
|
4 Operating System and Hardware Optimization |
|
|
75 | (24) |
|
What Limits MySQL's Performance? |
|
|
75 | (1) |
|
How to Select CPUs for MySQL |
|
|
76 | (1) |
|
Balancing Memory and Disk Resources |
|
|
76 | (1) |
|
Caching, Reads, and Writes |
|
|
76 | (1) |
|
|
77 | (1) |
|
|
78 | (1) |
|
An Overview of Flash Memory |
|
|
78 | (1) |
|
|
79 | (1) |
|
RAID Performance Optimization |
|
|
79 | (2) |
|
RAID Failure, Recovery, and Monitoring |
|
|
81 | (2) |
|
RAID Configuration and Caching |
|
|
83 | (3) |
|
|
86 | (1) |
|
|
87 | (2) |
|
Choosing a Disk Queue Scheduler |
|
|
89 | (1) |
|
|
90 | (2) |
|
|
92 | (3) |
|
|
95 | (1) |
|
|
96 | (3) |
|
5 Optimizing Server Settings |
|
|
99 | (26) |
|
How MySQL's Configuration Works |
|
|
100 | (1) |
|
Syntax, Scope, and Dynamism |
|
|
101 | (2) |
|
Persisted System Variables |
|
|
103 | (1) |
|
Side Effects of Setting Variables |
|
|
103 | (1) |
|
Planning Your Variable Changes |
|
|
104 | (1) |
|
|
105 | (1) |
|
Creating a MySQL Configuration File |
|
|
106 | (1) |
|
|
107 | (1) |
|
Inspecting MySQL Server Status Variables |
|
|
108 | (1) |
|
|
109 | (1) |
|
Per-Connection Memory Needs |
|
|
109 | (1) |
|
Reserving Memory for the Operating System |
|
|
109 | (1) |
|
|
110 | (1) |
|
|
111 | (1) |
|
Configuring MySQL's I/O Behavior |
|
|
112 | (1) |
|
The InnoDB Transaction Log |
|
|
113 | (1) |
|
|
113 | (2) |
|
|
115 | (3) |
|
Other I/O Configuration Options |
|
|
118 | (1) |
|
Configuring MySQL Concurrency |
|
|
119 | (1) |
|
|
120 | (2) |
|
|
122 | (2) |
|
|
124 | (1) |
|
6 Schema Design and Management |
|
|
125 | (30) |
|
Choosing Optimal Data Types |
|
|
126 | (1) |
|
|
127 | (1) |
|
|
127 | (1) |
|
|
128 | (7) |
|
|
135 | (1) |
|
|
136 | (3) |
|
|
139 | (3) |
|
|
142 | (2) |
|
|
144 | (1) |
|
Schema Design Gotchas in MySQL |
|
|
145 | (1) |
|
|
145 | (1) |
|
|
145 | (1) |
|
|
145 | (1) |
|
|
146 | (1) |
|
|
146 | (1) |
|
|
146 | (1) |
|
Schema Management as Part of the Data Store Platform |
|
|
147 | (7) |
|
|
154 | (1) |
|
7 Indexing for High Performance |
|
|
155 | (36) |
|
|
156 | (1) |
|
|
156 | (5) |
|
|
161 | (1) |
|
Indexing Strategies for High Performance |
|
|
162 | (1) |
|
Prefix Indexes and Index Selectivity |
|
|
162 | (3) |
|
|
165 | (2) |
|
Choosing a Good Column Order |
|
|
167 | (3) |
|
|
170 | (8) |
|
|
178 | (2) |
|
Using Index Scans for Sorts |
|
|
180 | (2) |
|
Redundant and Duplicate Indexes |
|
|
182 | (3) |
|
|
185 | (1) |
|
Index and Table Maintenance |
|
|
186 | (1) |
|
Finding and Repairing Table Corruption |
|
|
186 | (1) |
|
Updating Index Statistics |
|
|
187 | (1) |
|
Reducing Index and Data Fragmentation |
|
|
188 | (1) |
|
|
189 | (2) |
|
8 Query Performance Optimization |
|
|
191 | (36) |
|
|
191 | (1) |
|
Slow Query Basics: Optimize Data Access |
|
|
192 | (1) |
|
Are You Asking the Database for Data You Don't Need? |
|
|
192 | (2) |
|
Is MySQL Examining Too Much Data? |
|
|
194 | (4) |
|
Ways to Restructure Queries |
|
|
198 | (1) |
|
Complex Queries Versus Many Queries |
|
|
198 | (1) |
|
|
199 | (1) |
|
|
200 | (1) |
|
|
201 | (1) |
|
The MySQL Client/Server Protocol |
|
|
202 | (2) |
|
|
204 | (1) |
|
The Query Optimization Process |
|
|
205 | (12) |
|
The Query Execution Engine |
|
|
217 | (1) |
|
Returning Results to the Client |
|
|
218 | (1) |
|
Limitations of the MySQL Query Optimizer |
|
|
219 | (1) |
|
|
219 | (1) |
|
|
220 | (1) |
|
|
220 | (1) |
|
SELECT and UPDATE on the Same Table |
|
|
220 | (1) |
|
Optimizing Specific Types of Queries |
|
|
221 | (1) |
|
Optimizing COUNT() Queries |
|
|
221 | (2) |
|
|
223 | (1) |
|
Optimizing GROUP BY with ROLLUP |
|
|
223 | (1) |
|
Optimizing LIMIT and OFFSET |
|
|
223 | (2) |
|
Optimizing SQL CALC FOUND ROWS |
|
|
225 | (1) |
|
|
225 | (1) |
|
|
226 | (1) |
|
|
227 | (30) |
|
|
227 | (2) |
|
|
229 | (1) |
|
Replication Under the Hood |
|
|
230 | (1) |
|
Choosing Replication Format |
|
|
230 | (1) |
|
Global Transaction Identifiers |
|
|
231 | (1) |
|
Making Replication Crash Safe |
|
|
232 | (1) |
|
|
233 | (1) |
|
Multithreaded Replication |
|
|
234 | (3) |
|
Semisynchronous Replication |
|
|
237 | (1) |
|
|
237 | (2) |
|
|
239 | (1) |
|
|
239 | (1) |
|
|
240 | (1) |
|
|
240 | (1) |
|
|
241 | (1) |
|
|
241 | (1) |
|
|
242 | (2) |
|
|
244 | (3) |
|
Replication Administration and Maintenance |
|
|
247 | (1) |
|
|
247 | (1) |
|
Measuring Replication Lag |
|
|
248 | (1) |
|
Determining Whether Replicas Are Consistent with the Source |
|
|
249 | (2) |
|
Replication Problems and Solutions |
|
|
251 | (1) |
|
Binary Logs Corrupted on the Source |
|
|
251 | (1) |
|
|
251 | (1) |
|
|
252 | (1) |
|
|
252 | (1) |
|
Not Replicating All Updates |
|
|
252 | (1) |
|
Excessive Replication Lag |
|
|
252 | (2) |
|
Oversized Packets from the Source |
|
|
254 | (1) |
|
|
254 | (1) |
|
|
254 | (1) |
|
|
255 | (2) |
|
|
257 | (30) |
|
|
258 | (1) |
|
Defining Recovery Requirements |
|
|
259 | (1) |
|
Designing a MySQL Backup Solution |
|
|
260 | (1) |
|
Online or Offline Backups? |
|
|
261 | (2) |
|
|
263 | (2) |
|
|
265 | (1) |
|
Incremental and Differential Backups |
|
|
266 | (2) |
|
|
268 | (1) |
|
Managing and Backing Up Binary Logs |
|
|
269 | (1) |
|
Backup and Recovery Tools |
|
|
269 | (1) |
|
|
269 | (1) |
|
|
270 | (1) |
|
|
270 | (1) |
|
|
270 | (1) |
|
|
270 | (1) |
|
|
270 | (2) |
|
|
272 | (6) |
|
|
278 | (3) |
|
|
281 | (1) |
|
Restoring Logical Backups |
|
|
282 | (1) |
|
Restoring Raw Files from Snapshot |
|
|
283 | (1) |
|
Restoring with Percona XtraBackup |
|
|
284 | (1) |
|
Starting MySQL After Restoring Raw Files |
|
|
285 | (1) |
|
|
286 | (1) |
|
|
287 | (26) |
|
|
287 | (2) |
|
Read-Versus Write-Bound Workloads |
|
|
289 | (1) |
|
Understanding Your Workload |
|
|
289 | (1) |
|
|
290 | (1) |
|
|
291 | (1) |
|
|
291 | (1) |
|
Scaling Reads with Read Pools |
|
|
292 | (2) |
|
Managing Configuration for Read Pools |
|
|
294 | (1) |
|
Health Checks for Read Pools |
|
|
295 | (2) |
|
Choosing a Load-Balancing Algorithm |
|
|
297 | (1) |
|
|
298 | (1) |
|
Scaling Writes with Sharding |
|
|
299 | (1) |
|
Choosing a Partitioning Scheme |
|
|
300 | (2) |
|
Multiple Partitioning Keys |
|
|
302 | (1) |
|
|
302 | (1) |
|
|
303 | (3) |
|
|
306 | (5) |
|
|
311 | (2) |
|
|
313 | (12) |
|
|
313 | (1) |
|
|
314 | (3) |
|
|
317 | (1) |
|
MySQL on Virtual Machines |
|
|
318 | (1) |
|
|
318 | (1) |
|
Choosing the Right Machine Type |
|
|
319 | (1) |
|
Choosing the Right Disk Type |
|
|
320 | (2) |
|
|
322 | (2) |
|
|
324 | (1) |
|
|
325 | (18) |
|
|
326 | (1) |
|
Service Organization Controls Type 2 |
|
|
326 | (1) |
|
|
326 | (1) |
|
Payment Card Industry Data Security Standard |
|
|
327 | (1) |
|
Health Insurance Portability and Accountability Act |
|
|
327 | (1) |
|
Federal Risk and Authorization Management Program |
|
|
327 | (1) |
|
General Data Protection Regulation |
|
|
327 | (1) |
|
|
328 | (1) |
|
Building for Compliance Controls |
|
|
328 | (1) |
|
|
329 | (3) |
|
Separation of Roles and Data |
|
|
332 | (1) |
|
|
333 | (6) |
|
Backup and Restore Procedures |
|
|
339 | (2) |
|
|
341 | (2) |
A Upgrading MySQL |
|
343 | (6) |
B MySQL on Kubernetes |
|
349 | (4) |
Index |
|
353 | |