版本 6.1.7
问题:内存打满
现象:出现很多慢查询,一条简单的主键/唯一索引等值查询,在生成执行计划的时候耗时很长,但是实际去执行很快,这是啥情况,怎么排查一下(select 1和set也是很慢)
mysql> desc SELECT
-> dept_id,
-> dept_name,
-> dept_level,
-> leader_id,
-> leader_name,
-> count,
-> parent_id,
-> count_all,
-> child_count,
-> hrbp_uids
-> FROM
-> corp_dept
-> WHERE
-> (dept_id IN ('xxxxx'));
+-------------------+---------+------+-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+-------------------+---------+------+-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Projection_4 | 1.00 | root | | popo_im_info.corp_dept.dept_id, popo_im_info.corp_dept.dept_name, popo_im_info.corp_dept.dept_level, popo_im_info.corp_dept.leader_id, popo_im_info.corp_dept.leader_name, popo_im_info.corp_dept.count, popo_im_info.corp_dept.parent_id, popo_im_info.corp_dept.count_all, popo_im_info.corp_dept.child_count, popo_im_info.corp_dept.hrbp_uids |
| └─Point_Get_5 | 1.00 | root | table:corp_dept, index:PRIMARY(dept_id) | |
+-------------------+---------+------+-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> SELECT dept_id, dept_name, dept_level, leader_id, leader_name, count, parent_id, count_all, child_count, hrbp_uids FROM corp_dept WHERE (dept_id IN ('xxxx'));
+---------------+-----------+------------+-----------+-------------+-------+------------+-----------+-------------+-----------------------------------------------------------------------------------------------+
| dept_id | dept_name | dept_level | leader_id | leader_name | count | parent_id | count_all | child_count | hrbp_uids |
+---------------+-----------+------------+-----------+-------------+-------+------------+-----------+-------------+-----------------------------------------------------------------------------------------------+
| xxxx | G83 | 4 | G5593 | | 103 | D099114002 | 146 | 1 | [""] |
+---------------+-----------+------------+-----------+-------------+-------+------------+-----------+-------------+-----------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql>
还有set命令也是
甚至是select 1




