极客时间返利平台,你可以在上边通过山月的链接购买课程,并添加我的微信 (shanyue94) 领取返现。

# 如何得知一条 SQL 执行的时长?

Issue

欢迎在 Gtihub Issue 中回答此问题: Issue 210 (opens new window)

Author

回答者: liyihang (opens new window)

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 new window) and SHOW PROFILES (opens new window) statements are deprecated; expect them to be removed in a future MySQL release. Use the Performance Schema (opens new window) instead;

Last Updated: 6/26/2022, 10:48:10 AM