MySQL 5.7 Release Notes
Table of Contents
- 8.1 Optimization Overview
- 8.2 Optimizing SQL Statements
- 8.3 Optimization and Indexes
- 8.3.1 How MySQL Uses Indexes
- 8.3.2 Primary Key Optimization
- 8.3.3 Foreign Key Optimization
- 8.3.4 Column Indexes
- 8.3.5 Multiple-Column Indexes
- 8.3.6 Verifying Index Usage
- 8.3.7 InnoDB and MyISAM Index Statistics Collection
- 8.3.8 Comparison of B-Tree and Hash Indexes
- 8.3.9 Use of Index Extensions
- 8.3.10 Optimizer Use of Generated Column Indexes
- 8.3.11 Indexed Lookups from TIMESTAMP Columns
- 8.4 Optimizing Database Structure
- 8.5 Optimizing for InnoDB Tables
- 8.5.1 Optimizing Storage Layout for InnoDB Tables
- 8.5.2 Optimizing InnoDB Transaction Management
- 8.5.3 Optimizing InnoDB Read-Only Transactions
- 8.5.4 Optimizing InnoDB Redo Logging
- 8.5.5 Bulk Data Loading for InnoDB Tables
- 8.5.6 Optimizing InnoDB Queries
- 8.5.7 Optimizing InnoDB DDL Operations
- 8.5.8 Optimizing InnoDB Disk I/O
- 8.5.9 Optimizing InnoDB Configuration Variables
- 8.5.10 Optimizing InnoDB for Systems with Many Tables
- 8.6 Optimizing for MyISAM Tables
- 8.7 Optimizing for MEMORY Tables
- 8.8 Understanding the Query Execution Plan
- 8.9 Controlling the Query Optimizer
- 8.10 Buffering and Caching
- 8.11 Optimizing Locking Operations
- 8.12 Optimizing the MySQL Server
- 8.13 Measuring Performance (Benchmarking)
- 8.14 Examining Server Thread (Process) Information
- 8.14.1 Accessing the Process List
- 8.14.2 Thread Command Values
- 8.14.3 General Thread States
- 8.14.4 Query Cache Thread States
- 8.14.5 Replication Source Thread States
- 8.14.6 Replication Replica I/O Thread States
- 8.14.7 Replication Replica SQL Thread States
- 8.14.8 Replication Replica Connection Thread States
- 8.14.9 NDB Cluster Thread States
- 8.14.10 Event Scheduler Thread States
- 8.15 Tracing the Optimizer
- 8.15.1 Typical Usage
- 8.15.2 System Variables Controlling Tracing
- 8.15.3 Traceable Statements
- 8.15.4 Tuning Trace Purging
- 8.15.5 Tracing Memory Usage
- 8.15.6 Privilege Checking
- 8.15.7 Interaction with the --debug Option
- 8.15.8 The optimizer_trace System Variable
- 8.15.9 The end_markers_in_json System Variable
- 8.15.10 Selecting Optimizer Features to Trace
- 8.15.11 Trace General Structure
- 8.15.12 Example
- 8.15.13 Displaying Traces in Other Applications
- 8.15.14 Preventing the Use of Optimizer Trace
- 8.15.15 Testing Optimizer Trace
- 8.15.16 Optimizer Trace Implementation
This chapter explains how to optimize MySQL performance and provides examples. Optimization involves configuring, tuning, and measuring performance, at several levels. Depending on your job role (developer, DBA, or a combination of both), you might optimize at the level of individual SQL statements, entire applications, a single database server, or multiple networked database servers. Sometimes you can be proactive and plan in advance for performance, while other times you might troubleshoot a configuration or code issue after a problem occurs. Optimizing CPU and memory usage can also improve scalability, allowing the database to handle more load without slowing down.