Open wangaiyang2013 opened 7 years ago
我也是这个问题,楼上可有解决方案?
我也碰上这个问题了,怎么解决,我的环境是Ubuntu!
同样的问题
在执行make指令之前修改 main.cc的文件即可原数值 #define EXPLAIN_ROWS 8,这表示的是mysql执行explain语句的返回的cols行数的那一列是第八列,目前我的eplain语句返回的cols行数在第十列,所以我改成#define EXPLAIN_ROWS 10,这样就能运行了
[root@qk-yunwei sqladvisor]# ./sqladvisor -h 192.168.1.XX -P 3306 -u XXX-p 'XXX' -d qk_auth -q "select af.* from auth_function af inner join auth_function_permission afp on af.id = afp.function_id where af.id=1;" -v 1 2017-07-28 15:44:12 1198 [Note] 2017-07-28 15:44:12 1198 [Note] 第2步:开始解析where中的条件:(
af
.id
= 1)2017-07-28 15:44:12 1198 [Note] show index from auth_function
2017-07-28 15:44:12 1198 [Note] show table status like 'auth_function'
2017-07-28 15:44:12 1198 [Note] select count(*) from ( select
id
fromauth_function
FORCE INDEX( PRIMARY ) order by id DESC limit 13)af
where (af
.id
= 1)2017-07-28 15:44:12 1198 [Note] 第3步:表auth_function的行数:27,limit行数:13,得到where条件中(
af
.id
= 1)的选择度:132017-07-28 15:44:12 1198 [Note] 第4步:开始解析join on条件:af.id=afp.function_id
2017-07-28 15:44:12 1198 [Note] 第5步:开始选择驱动表,一共有2个候选驱动表
2017-07-28 15:44:12 1198 [Note] explain select * from auth_function
Segmentation fault