如何得知一条 SQL 执行的时长?
Issue 欢迎在 Gtihub Issue 中回答此问题: Issue 210 (opens in a new tab)
Author 回答者: liyihang (opens in a new tab)
1.show profiles; 2.set profiling = 1; 3.show databases; 4.show profiles; ----------+------------+----------------+ | Query_ID | Duration | Query | +----------+------------+----------------+ | 1 | 0.00124300 | show warnings | | 2 | 0.03788000 | show databases | +----------+------------+----------------+
NOTE: The SHOW PROFILE (opens in a new tab) and SHOW PROFILES (opens in a new tab) statements are deprecated; expect them to be removed in a future MySQL release. Use the Performance Schema (opens in a new tab) instead;