🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
#### profile机制 使用mysql提供profile机制完成。profile记录每次执行的具体时间,精确的时间到小数点8位. 开启profile机制 ~~~ set profiling = 1; ~~~ 查看记录的时间 ~~~ show profiles; ~~~ 结果 ~~~ +----------+------------+--------------------+ | Query_ID | Duration | Query | +----------+------------+--------------------+ | 1 | 0.00202925 | select * from user | | 2 | 0.00033075 | select * from t2 | | 3 | 0.00067275 | select * from t2 | +----------+------------+--------------------+ ~~~ 不需要进行sql语句分析时,最好将其关闭. ~~~ set profile = 0; ~~~