MySQL 的 SQL 法 整主要都是使用 EXPLAIN , 但是 法知道 的 Ram(Memory)/CPU 等使用量.
於 MySQL 5.0.37 以上 始支援 MySQL Query Profiler, 可以查 到此 SQL 行多少 , 看出 CPU/Memory 使用量, 行 程中 System lock, Table lock 花多少 等等.
MySQL Query Profile 介 可 : Using the New MySQL Query Profiler (2007.04.05 表)
效能分析主要分下述三 ( 自上篇):
Bottleneck analysis - focuses on answering the questions: What is my database server waiting on; what is a user connection waiting on; what is a piece of SQL code waiting on?
Workload analysis - examines the server and who is logged on to determine the resource usage and activity of each.
Ratio-based analysis - utilizes a number of rule-of-thumb ratios to gauge performance of a database, user connection, or piece of code.
MySQL Query Profile 使用方法