对一个sql域名,explain 只是查询出sql的执行计划,没有显示具体的sql路径
如果要显示具体执行路径,我们只要 在 show warnings 就可以了,例如:
explain extend select a.thd_id,b.THREAD_OS_ID,a.user
,b.TYPE from sys.processlist
a,performance_schema.threads b where b.thread_id=a.thd_id;
show WARNINGS;
就会打印出
Note1003/* select#1 */ select `a`.`thd_id` AS `thd_id`,`performance_schema`.`b`.`THREAD_OS_ID` AS `THREAD_OS_ID`,`a`.`user` AS `user`,`performance_schema`.`b`.`TYPE` AS `TYPE` from `sys`.`processlist` `a` join `performance_schema`.`threads` `b` where (`performance_schema`.`b`.`THREAD_ID` = `a`.`thd_id`)
具体的sql执行路径
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!