Home >Database >Mysql Tutorial >MySQL SQL语句性能分析_MySQL

MySQL SQL语句性能分析_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:41:331504browse

bitsCN.com
MySQL SQL语句性能分析 set profiling = 1;select * from g_staff; show profiles   SHOW profile CPU,BLOCK IO  FOR query 88; select * from NFORMATION_SCHEMA.PROFILING 将 MySQL’s SHOW PROFILES 命令的结果转成适合阅读的格式 SET @query_id := 5;SELECT     STATE,     SUM(DURATION) AS Total_R,     ROUND(          100 * SUM(DURATION) / (               SELECT                    SUM(DURATION)               FROM                    INFORMATION_SCHEMA.PROFILING               WHERE                        QUERY_ID = @query_id          ),          2     ) AS Pct_R,     COUNT(*) AS Calls,     SUM(DURATION) / COUNT(*) AS "R/Call"FROM     INFORMATION_SCHEMA.PROFILINGWHERE     QUERY_ID = @query_idGROUP BY     STATEORDER BY     Total_R DESC;  作者 bengda bitsCN.com

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn