Efficient MySQL Performance
by Daniel Nichter
Copyright 2022 Daniel Nichter. All rights reserved.
Printed in the United States of America.
Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .
- Acquisitions Editor: Andy Kwan
- Development Editor: Corbin Collins
- Production Editor: Katherine Tozer
- Copyeditor: Justin Billing
- Proofreader: Piper Editorial Consulting, LLC
- Indexer: Amnet Systems LLC
- Interior Designer: David Futato
- Cover Designer: Karen Montgomery
- Illustrator: Kate Dullea
- December 2021: First Edition
Revision History for the First Edition
- 2021-11-30: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781098105099 for release details.
The OReilly logo is a registered trademark of OReilly Media, Inc. Efficient MySQL Performance, the cover image, and related trade dress are trademarks of OReilly Media, Inc.
The views expressed in this work are those of the author, and do not represent the publishers views. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-098-10509-9
[LSI]
Preface
A gap in MySQL literature exists between basic MySQL knowledge and advanced MySQL performance.There are several books about the former, and one book about the latter: High Performance MySQL, 4th Edition, by Silvia Botros and Jeremy Tinley (OReilly).This is the first book to bridge the gap.
The gap exists because MySQL is complex, and its difficult to teach performance without addressing that complexitythe proverbial elephant in the room.But engineers using (not managing) MySQL should not need to become MySQL experts to achieve remarkable MySQL performance.To bridge the gap, this book is unapologetically efficientpay no attention to the elephant; its friendly.
Efficient MySQL performance means focus: learning and applying only the best practices and techniques that directly affect remarkable MySQL performance.Focus dramatically narrows the scope of MySQL complexity and allows me to show you a much simpler and faster path through the vast and complex field of MySQL performance.The journey begins with the first sentence of , Performance is query response time.From there, we move fast through indexes, data, access patterns, and a lot more.
On a scale of one to fivewhere one is an introduction for anyone, and five is a deep dive for aspiring expertsthis book ranges from three to four: deep, but far from the bottom.I presume that youre an experienced engineer who has basic knowledge of and experience with a relational database (MySQL or otherwise), so I do not explain SQL or database fundamentals.I presume that youre an accomplished programmer who is responsible for one or more applications that use MySQL, so I continually reference the application and trust that you know the details of your application.I also presume that youre familiar with computers in general, so I talk freely about hardware, software, networks, and so forth.
Since this book focuses on MySQL performance for engineers using MySQL, not managing it, a few references to MySQL configuration are made when necessary but not explained.For help configuring MySQL, ask a DBA where you work.If you dont have a DBA, hire a MySQL consultantthere are many great consultants with affordable contract options.You can also learn by reading the MySQL Reference Manual.The MySQL manual is superb and experts use it all the time, so youre in good company.
Conventions Used in This Book
The following typographical conventions are used in this book:
ItalicIndicates new terms, URLs, email addresses, filenames, and file extensions.
Constant width
Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.
Constant width bold
Shows commands or other text that should be typed literally by the user.
Constant width italic
Shows text that should be replaced with user-supplied values or by values determined by context.
Tip
This element signifies a tip or suggestion.
Note
This element signifies a general note.
Warning
This element indicates a warning or caution.
Using Code Examples
Supplemental material (code examples, exercises, etc.) is available for download at https://github.com/efficient-mysql-performance.
If you have a technical question or a problem using the code examples, please email .
This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless youre reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing examples from OReilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your products documentation does require permission.
We appreciate, but generally do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: Efficient MySQL Performance by Daniel Nichter (OReilly). Copyright 2022 Daniel Nichter, 978-1-098-10509-9.
If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .
OReilly Online Learning
Note
For more than 40 years, OReilly Media has provided technology and business training, knowledge, and insight to help companies succeed.
Our unique network of experts and innovators share their knowledge and expertise through books, articles, and our online learning platform. OReillys online learning platform gives you on-demand access to live training courses, in-depth learning paths, interactive coding environments, and a vast collection of text and video from OReilly and 200+ other publishers. For more information, visit http://oreilly.com.
How to Contact Us
Please address comments and questions concerning this book to the publisher:
- OReilly Media, Inc.
- 1005 Gravenstein Highway North