You'll find several books on basic or advanced MySQL performance, but nothing in between. That's because explaining MySQL performance without addressing its complexity is difficult. This practical book bridges the gap by teaching software engineers mid-level MySQL knowledge beyond the fundamentals, but well shy of deep-level internals required by database administrators (DBAs).
Daniel Nichter shows you how to apply the best practices and techniques that directly affect MySQL performance. You'll learn how to improve performance by analyzing query execution, indexing for common SQL clauses and table joins, optimizing data access, and understanding the most important MySQL metrics. You'll also discover how replication, transactions, row locking, and the cloud influence MySQL performance.
Understand why query response time is the North Star of MySQL performance
Learn query metrics in detail, including aggregation, reporting, and analysis
See how to index effectively for common SQL clauses and table joins
Explore the most important server metrics and what they reveal about performance
Dive into transactions and row locking to gain deep, actionable insight
Achieve remarkable MySQL performance at any scale
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# Efficient MySQL Performance: Best Practices and Techniques — Reading Guide
## 【One-Line Pitch】
A practical, mid-level guide for software engineers who need to make MySQL fast without becoming database administrators — covering query analysis, indexing strategy, and the metrics that actually matter for performance troubleshooting.
## 【Book Arc】
- **Opening (~0%–9%)**: Establishes the book's core philosophy — query response time is the "North Star" of MySQL performance — and sets up the reader's toolkit: query metrics, reporting, and analysis workflows that turn raw data into actionable insight.
- **Early (~9%–28%)**: Dives deep into query response time as a measurable quantity, explaining query load, concurrency implications, lock time gotchas (Performance Schema vs. slow query log), and the critical distinction between direct and indirect query optimization.
- **Early-to-Middle (~28%–38%)**: Introduces the "query optimization journey" framework, then pivots to why scaling up hardware is a trap — workload (queries + data + access patterns) is what actually determines whether faster hardware helps at all.
- **Middle (~38%–47%)**: Delivers a visual, example-driven tour of MySQL indexes: leftmost prefix requirements, secondary index lookups, the "hidden" primary key appended to secondary indexes, and how GROUP BY and ORDER BY can leverage index ordering to avoid filesorts.
- **Late (~47% onward)**: Extends into access patterns, sharding, and scale-out strategies — offloading reads, enqueueing writes, partitioning data, and the honest assessment of when you shouldn't use MySQL at all.
## 【Key Takeaways】
- **Query response time is the primary metric** (Early): All other performance indicators are secondary to how long queries actually take. Load — total query time divided by clock time — reveals concurrency: load above 1.0 means multiple instances of a query run simultaneously, and load above 10 is likely a slow query worth investigating.
- **Lock time sources differ critically** (Early): Performance Schema lock time excludes row lock waits (only table and metadata locks), making it nearly useless for write-performance analysis. The slow query log includes all lock waits — use it when diagnosing write bottlenecks.
- **Query profiles and reports serve different purposes** (Early): A query profile shows which queries are slowest at a glance; a query report is an organized information dump for deep analysis. Stability matters — unstable queries are harder to analyze because their execution varies, often due to factors outside MySQL.
- **Direct optimization comes first** (Early): Changes to queries and indexes solve most performance problems and should be your first move. Indirect optimization (schema, hardware, configuration) is secondary — don't reach for it until direct methods are exhausted.
- **Scaling up is a trap, not a strategy** (Early–Middle): Faster hardware doesn't change how the application uses MySQL — if the workload causes table scans, more memory won't help. Cloud scaling is expensive (RDS costs double per instance size) and unsustainable; optimization is the durable answer.
- **Leftmost prefix is the index law** (Middle): To use an index, a query must use a leftmost prefix of it. Indexes (a, b) and (b, a) are different indexes with different leftmost prefixes — order matters fundamentally.
- **The hidden primary key enables ORDER BY optimizations** (Middle): Every secondary index has the primary key appended at its rightmost position. This allows ORDER BY on the primary key to avoid filesorts when the secondary index's leftmost prefix conditions are met — a subtle but powerful optimization for real tables.
- **Indexes implicitly group data** (Middle): GROUP BY on a leftmost prefix column can use the index's inherent ordering to identify groups without sorting — MySQL knows each new value starts a new group, eliminating expensive grouping operations.
## 【Reading Tips】
- **Skim the visual index examples** (Middle, ~38%–47%): The book uses a chemical elements table (elem) with figures showing index structures. These visuals are the clearest way to internalize leftmost prefixes and secondary index lookups — don't skip the figures even if the text feels repetitive.
- **Deep-read the query metrics chapters** (Early, ~9%–28%): Query load, lock time sources, and the profile-vs-report distinction are foundational. Understanding these concepts makes every later chapter (indexing, sharding, access patterns) more actionable.
- **Treat the "Practice" sections as checkpoints**: Each chapter ends with a practice exercise (e.g., "Identify Slow Queries," "Describe an Access Pattern"). Actually doing these — not just reading them — is where the book's value materializes.
- **Watch for the gotchas**: The book deliberately highlights traps like Performance Schema lock time excluding row locks, and why you shouldn't use STRAIGHT_JOIN. These are the details that separate engineers who merely read about MySQL from those who can diagnose it.
- **Skip the hardware discussion if you're cloud-native**: The scaling-up critique is useful context, but if you're already on managed cloud MySQL, focus on the query optimization and indexing chapters where the actionable content lives.
## 【Coverage Limits】
This guide covers the book's opening through the indexing chapters (~47% of the book). The excerpts do not cover the later chapters on access patterns, sharding strategies, replication, transactions, row locking, or cloud-specific performance considerations in detail — those sections are noted in the table of contents but not analyzed here.
##
Page 7
. . . . . . . . . . . . . . . . . . . . . . . . . . . 123 MySQL Does Nothing 124 Performance Destabilizes at the Limit 125 Toyota and Ferrari 130 Data Access...
hing just by looking at it (which queries are the slowest), a query report is an organized information dump used for query analysis. As such, the more inform...
tools are query-specific optimizations. To name only a few from “Optimizing SELECT Statements” in the MySQL manual: • Range Optimization • Index Merge Optimi...
over • An ALTER TABLE statement to drop the duplicate index pt-duplicate-key-checker is mature and well tested, but always think carefully before dropping an...
age over a sufficiently long period. By contrast, duplicate indexes are easier to find: use pt-duplicate-key-checker. Again: be careful when dropping indexes...
nd react to others cars, especially at highway speeds. When there are too many cars on the road, they cause a traffic jam. The only solution (apart from addi...
ata. Data is valuable to you, but it’s dead weight to MySQL. If you cannot delete or archive data (see “Delete or Archive Data” on page 115), then you should...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Efficient MySQL Performance Best Practices and Techniques (Daniel Nichter)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Efficient MySQL Performance Best Practices and Techniques (Daniel Nichter)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment