近日在客户主机上得到一个奇葩问题,
CPU莫名其妙经常占用100%,查看对应的进程,全是
sQL进程如下
INSERT INTO `search_tmp_64b18bb8476a53_64989566` SELECT `main_select`.`entity_id`, SUM(score) AS `re***
查看详细日志为
INSERT INTO `search_tmp_64b18333281ac9_71844131` SELECT `main_select`.`entity_id`, SUM(score) AS `relevance` FROM (SELECT DISTINCT `eav_index`.`entity_id`, (((0) + (0)) * 1 + LEAST((MATCH (data_index) AGAINST ('Dental* ceramic* bearings*' IN BOOLEAN MODE)), 1000000) * POW(2, search_weight)) AS `score` FROM `catalog_product_index_eav` AS `eav_index` INNER JOIN `catalogsearch_fulltext_scope2` AS `search_index` ON eav_index.entity_id = search_index.entity_id INNER JOIN `catalog_eav_attribute` AS `cea` ON search_index.attribute_id = cea.attribute_id INNER JOIN `cataloginventory_stock_status` AS `stock_index` ON stock_index.product_id = eav_index.entity_id AND `stock_index`.`website_id` = 0 AND `stock_index`.`stock_status` = 1 AND `stock_index`.`stock_id` = 1 INNER JOIN `catalog_category_product_index_store2` AS `category_ids_index` ON eav_index.entity_id = category_ids_index.product_id AND category_ids_index.store_id = '2' WHERE (eav_index.store_id = '2') AND (`eav_index`.`attribute_id` = 99 AND `eav_index`.`value` in ('3', '4') AND `eav_index`.`store_id` = '2') AND (category_ids_index.category_id in ('6')) AND (MATCH (data_index) AGAINST ('Dental* ceramic* bearings*' IN BOOLEAN MODE))) AS `main_select` GROUP BY `entity_id` ORDER BY `relevance` DESC, `entity_id` DESC LIMIT 10000;
全是这类的sql语句占用了全部CPU,有时把服务器都拉死机。