查看系统中最近执行的语句 ST.text AS '执行的SQL语句', QS.execution_count AS '执行次数', QS.total_elapsed_time AS '耗时', QS.total_logical_reads AS '逻辑读取次数', QS.total_logical_writes AS '逻辑写入次数', QS.total_physical_reads AS '物理读取次数', QS.creation_time AS '执行时间' , QS.* FROM sys.…
有2个方法: 1.使用processlist,但是有个弊端,就是只能查看正在执行的sql语句,对应历史记录,查看不到.好处是不用设置,不会保存. -- use information_schema; -- show processlist; 或者: -- select * from information_schema.`PROCESSLIST` where info is not null; 2.开启日志模式 -- 1.设置 -- SET GLOBAL log_output = 'TABLE'…
mysql查看正在执行的sql语句 2015年08月21日 17:32:59 阅读数:15398 有2个方法: 1.使用processlist,但是有个弊端,就是只能查看正在执行的sql语句,对应历史记录,查看不到.好处是不用设置,不会保存. -- use information_schema; -- show processlist; 或者: -- select * from information_schema.`PROCESSLIST` where info is not null;…
SELECT [session_id], [request_id], [cpu_time], [start_time] AS '开始时间', [status] AS '状态', [command] AS '命令', dest.[text] AS 'sql语句', [reads] AS '物理读次数', [writes] AS '写次数', [logical_reads] AS '逻辑读次数', [row_count] AS '返回结果行数', [blocking_s…