Server Tuning

Server Tuning and the Performance Schema

Indexes and Optimizer and EXPLAIN made single queries cheaper. This section tunes the server under them and shows how to find the statements worth fixing. The method never changes: read a counter, change one variable, apply a load, read the counter again. All numbers come from a small mysql:9.7 container (9.7.2, 6 GB, four CPUs) under WSL2 6 on this book's Windows 11 PC, holding shop plus a 3-million-row page_views table. Absolute figures differ on real servers; the direction of each effect does not. Persist what you keep with SET PERSIST or the option file (Option Files and Variables).

Subsections