信息模式示例
PROCESSLIST
这将按顺序显示所有活动和休眠查询,然后显示多长时间。
SELECT * FROM information_schema.PROCESSLIST ORDER BY INFO DESC, TIME DESC;
这是关于时间帧的更多细节,因为它默认为秒
SELECT ID, USER, HOST, DB, COMMAND,
TIME as time_seconds,
ROUND(TIME / 60, 2) as time_minutes,
ROUND(TIME / 60 / 60, 2) as time_hours,
STATE, INFO
FROM information_schema.PROCESSLIST ORDER BY INFO DESC, TIME DESC;
存储过程搜索
通过所有 Stored Procedures
轻松搜索单词和通配符。
SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_DEFINITION LIKE '%word%';