Table of Contents目录
This chapter explains how to optimize MySQL performance and provides examples. 本章介绍如何优化MySQL性能并提供示例。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. 根据您的工作角色(开发人员、DBA或两者的组合),您可以在单个SQL语句、整个应用程序、单个数据库服务器或多个联网数据库服务器的级别上进行优化。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.优化CPU和内存使用也可以提高可伸缩性,允许数据库在不降低速度的情况下处理更多负载。