Magento2 Mysql正在使用完整的CPU,并一次又一次地运行相同的查询

时间:2018-07-18 11:47:05

标签: php magento2

我们遇到了Mysql正在使用完整CPU并一遍又一遍地运行相同查询的情况。

SELECT `e`.*, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position`, SUM(soi.qty_ordered) AS `ordered_qty`, `order`.`state`, `stock_status_index`.`stock_status` AS `is_salable` FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '4' AND price_index.customer_group_id = 0
INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=8 AND cat_index.category_id='89' AND cat_index.is_parent=1
LEFT JOIN `sales_order_item` AS `soi` ON soi.product_id = e.entity_id
INNER JOIN `sales_order` AS `order` ON order.entity_id = soi.order_id
LEFT JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id AND stock_status_index.website_id = 0 AND stock_status_index.stock_id = 1 WHERE (order.state <> 'canceled' and soi.parent_item_id IS NULL AND soi.product_id IS NOT NULL) GROUP BY `soi`.`product_id` ORDER BY `ordered_qty` DESC
LIMIT 6 

有人可以帮助我吗?为什么会出现这个问题?

0 个答案:

没有答案