gpt4 book ai didi

mysql - 将 Magento 升级到 1.13.1 后的问题查询

转载 作者:可可西里 更新时间:2023-11-01 08:48:35 25 4
gpt4 key购买 nike

我们几天前将我们的 Enterprise 升级到 1.13.1,以利用新的索引系统,但是一种类型的查询使我们的操作非常缓慢 - 索引、类别保存和产品保存都会在以下位置触发此类查询一些观点:

INSERT IGNORE INTO `catalog_category_product_index_tmp` (`category_id`, `product_id`, `position`, `is_parent`, `store_id`, `visibility`) SELECT `cc`.`entity_id` AS `category_id`, `ccp`.`product_id`, ccp.position + 10000 AS `position`, 0 AS `is_parent`, 1 AS `store_id`, IFNULL(cpvs.value, cpvd.value) AS `visibility` FROM `catalog_category_entity` AS `cc`
INNER JOIN `catalog_category_entity` AS `cc2` ON cc2.path LIKE CONCAT(`cc`.`path`, '/%') AND cc.entity_id NOT IN (1)
INNER JOIN `catalog_category_product` AS `ccp` ON ccp.category_id = cc2.entity_id
INNER JOIN `catalog_product_website` AS `cpw` ON cpw.product_id = ccp.product_id
INNER JOIN `catalog_product_entity_int` AS `cpsd` ON cpsd.entity_id = ccp.product_id AND cpsd.store_id = 0 AND cpsd.attribute_id = 96
LEFT JOIN `catalog_product_entity_int` AS `cpss` ON cpss.entity_id = ccp.product_id AND cpss.attribute_id = cpsd.attribute_id AND cpss.store_id = 1
INNER JOIN `catalog_product_entity_int` AS `cpvd` ON cpvd.entity_id = ccp.product_id AND cpvd.store_id = 0 AND cpvd.attribute_id = 102
LEFT JOIN `catalog_product_entity_int` AS `cpvs` ON cpvs.entity_id = ccp.product_id AND cpvs.attribute_id = cpvd.attribute_id AND cpvs.store_id = 1
INNER JOIN `catalog_category_entity_int` AS `ccad` ON ccad.entity_id = cc.entity_id AND ccad.store_id = 0 AND ccad.attribute_id = 51
LEFT JOIN `catalog_category_entity_int` AS `ccas` ON ccas.entity_id = cc.entity_id AND ccas.attribute_id = ccad.attribute_id AND ccas.store_id = 1 WHERE (cpw.website_id = '1') AND (IFNULL(cpss.value, cpsd.value) = 1) AND (IFNULL(cpvs.value, cpvd.value) IN (4, 2)) AND (IFNULL(ccas.value, ccad.value) = 1) AND (`cc`.`entity_id` >= '1') AND (`cc`.`entity_id` < 501)

最多可能需要 30 分钟才能完成。它要么是那个表,要么是 INSERT IGNORE INTO catalog_category_product_cat_tmp

我们有大约 80,000 个类别,这可能会导致问题,但我们肯定不是世界上唯一拥有那么多类别的商店。

在 MySQL 中执行 SHOW PROFILE 时,它说它停留在 Sending data 上。

有没有人有这方面的经验?是否有任何索引可以添加到表中以使其更快?有什么方法可以查看查询的哪一部分是实际瓶颈?

最佳答案

没有简单的解决方案 - 最终重写了索引器。

关于mysql - 将 Magento 升级到 1.13.1 后的问题查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20642050/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com