Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Baron Schwartz, Peter Zaitsev, Vadim Tkachenko

Rating No ratings yet

How can you bring out MySQL’s full power? With High Performance MySQL, you’ll learn advanced techniques for everything from designing schemas, indexes, and queries to tuning your MySQL server, operating system, and hardware to their fullest potential. This guide also teaches you safe and practical ways to scale applications through replication, load balancing, high availability, and failover.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A practitioner's field manual for making MySQL fast and keeping it alive: it teaches you to measure performance by response time, then tune schemas, queries, servers, and replication accordingly. Best for engineers who already run MySQL in production and need depth beyond the manual. 【Book Arc】 - **Opening (~0%–10%)**: Frames the whole discipline — what "high performance" means, how MySQL's architecture and storage engines (with MVCC and isolation-level trade-offs) shape everything later. Solves the "where do I even start" problem. - **Early (~10%–30%)**: Establishes benchmarking and profiling as the foundation — designing realistic benchmarks, reading the MySQL Benchmark Suite, and using query profiling tools to find the worst offenders by time, not by guesswork. - **Middle (~30%–50%)**: Moves into diagnosis and schema design — capturing diagnostic data for intermittent problems, using INFORMATION_SCHEMA statistics and system-call tracing, and choosing column types (e.g., ENUM vs VARCHAR joins) that actually change query speed. - **Late (~50%–70%)**: Advanced application-side patterns — materialized views via Flexviews, counter tables, and other ways to restructure hot data so concurrency stops being the bottleneck. - **Ending (~70%–100%)**: Operational durability — backup and recovery strategy (logical dumps, filesystem snapshots, point-in-time recovery, InnoDB crash recovery), binary-log management, replication, and the tooling ecosystem (XtraBackup, mydumper, monitoring tools). 【Key Takeaways】 - **Performance is response time, not resource usage** (Early): the book defines performance by task completion time, which reframes optimization around queries and statements rather than CPU or memory graphs. - **Benchmark deliberately, not accidentally** (Early): match the benchmark to the workload (don't use a decision-support benchmark for OLTP), snapshot production data, and accept that single-node tests trade realism for fewer variables. - **Profile before you optimize** (Early): tools like pt-query-digest rank queries by total time and flag high-variance queries as prime candidates — the variance-to-mean ratio is a practical signal. - **Intermittent problems need a trigger and a data collector** (Middle): the hard part is knowing when the problem happens; thresholds should sit above healthy baselines, not at them. - **Storage engine choice changes query behavior** (Early): a query like `SELECT COUNT(*)` is fast on MyISAM but not necessarily elsewhere — engine migration can make things slower, not faster. - **Schema details have measurable costs** (Middle): joining ENUM columns to VARCHAR columns was slower than ENUM-to-ENUM, so lookup tables with integer keys remain a sound design habit. - **Restructure hot data instead of fighting it** (Late): materialized views and separate counter tables reduce contention and let complex queries become simple, fast ones. - **Backups are a design problem, not a checkbox** (Ending): the book treats binary-log management, snapshots, point-in-time recovery, and crash recovery as one connected discipline. 【Reading Tips】 - Deep-read the benchmarking and profiling chapters early — they give you the measurement vocabulary the rest of the book assumes. - Skim the tool listings (backup utilities, monitoring systems) on a first pass; return when you actually need to pick one. - Treat the storage-engine and schema chapters as reference: revisit them when a specific query misbehaves. - The backup/recovery material is the highest-stakes section — read it with your own recovery plan open beside you. - Don't expect copy-paste recipes; the book teaches judgment about when a technique applies. 【Coverage Limits】 The excerpts are heavily front-loaded (table of contents, acknowledgments, early chapters) with only fragments from the middle and late sections, so the replication, high-availability, and failover material is only partially represented here.
Excerpt 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719 Table of Contents | xiii From Jeremy I would again like to thank An...
View in text
Excerpt 2
ig? We’ve built and managed—or helped build and manage—many InnoDB databases in the 3 TB to 5 TB range, or even larger. That’s on a single server, not sharde...
View in text
Excerpt 3
it. # Scores: V/M = 0.21 # Query_time sparkline: | _^_.^_ | # Time range: 2008-09-13 21:51:55 to 22:45:30 # Attribute pct total min max avg 95% stddev median...
View in text
Excerpt 4
rimary keys to avoid using character-based values in joins. However, there’s another benefit to converting the columns: according to the Data_ length column...
View in text
Excerpt 5
ven though that column isn’t technically part of the index: mysql> EXPLAIN SELECT actor_id, last_name -> FROM sakila.actor WHERE last_name = 'HOPPER'\G *****...
View in text
Excerpt 6
Here’s an example: mysql> SELECT MIN(actor_id) FROM sakila.actor WHERE first_name = 'PENELOPE'; Because there’s no index on first_name, this query performs a...
View in text
Excerpt 7
binary protocol to create and execute prepared statements. As you can see, the syntax is a little awkward compared to just typing the SELECT state- ment dire...
View in text
Excerpt 8
SERT queries in comparison to these complex SELECT queries. One of the ways to tell if you are benefiting from the query cache is to examine the query cache...
View in text
Tags
AI categories
DatabaseSQLBackend
ISBN: 1449314287
Publisher: O’Reilly Media
Publish Year: 2012
Language: English
Pages: 826
File Format: PDF
File Size: 15.9 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…