domel Posted November 3, 2014 Share Posted November 3, 2014 Hi, we have problem with MySQL on clinent's box, exactly it's a Percona 5.5.40 running on 2x Xeon E5-2620, 128GB ram. Some time ago they had many table locks (MyISAM) so they moved all the tables to InnoDB. It was working for a while. For now we observing many MySQL processess with status "Copying to tmp table", all or most of them are going to slow query log: SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quantity, cu.`quantity` AS customization_quantity, pl.`name`,pl.`description_short`, pl.`available_now`, pl.`available_later`, p.`id_product`, p.`id_category_default`, p.`id_supplier`, p.`id_manufacturer`, p.`on_sale`, p.`ecotax`, p.`additional_shipping_cost`, p.`available_for_order`,p.`quantity`, p.`price`, p.`weight`, p.`width`, p.`height`, p.`depth`, p.`out_of_stock`, p.`active`, p.`date_add`, p.`date_upd`, IFNULL(pa.`minimal_quantity`, p.`minimal_quantity`) as minimal_quantity,t.`id_tax`, tl.`name` AS tax, t.`rate`, pa.`price` AS price_attribute, pa.`quantity` AS quantity_attribute,pa.`ecotax` AS ecotax_attr, pl.`link_rewrite`, cl.`link_rewrite` AS category, CONCAT(cp.`id_product`, cp.`id_product_attribute`) AS unique_id,IF (IFNULL(pa.`reference`, '') = '', p.`reference`, pa.`reference`) AS reference,IF (IFNULL(pa.`supplier_reference`, '') = '', p.`supplier_reference`, pa.`supplier_reference`) AS supplier_reference,(p.`weight`+ pa.`weight`) weight_attribute,IF (IFNULL(pa.`ean13`, '') = '', p.`ean13`, pa.`ean13`) AS ean13, IF (IFNULL(pa.`upc`, '') = '', p.`upc`, pa.`upc`) AS upc,pai.`id_image` as pai_id_imageFROM `ps_cart_product` cpLEFT JOIN `ps_product` p ON p.`id_product` = cp.`id_product`LEFT JOIN `ps_product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = 1)LEFT JOIN `ps_product_attribute` pa ON (pa.`id_product_attribute` = cp.`id_product_attribute`)LEFT JOIN `ps_tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group`AND tr.`id_country` = 17AND tr.`id_state` = 0)LEFT JOIN `ps_tax` t ON (t.`id_tax` = tr.`id_tax`)LEFT JOIN `ps_tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = 1)LEFT JOIN `ps_customization` cu ON (p.`id_product` = cu.`id_product`)LEFT JOIN `ps_product_attribute_image` pai ON (pai.`id_product_attribute` = pa.`id_product_attribute`)LEFT JOIN `ps_category_lang` cl ON (p.`id_category_default` = cl.`id_category` AND cl.`id_lang` = 1)WHERE cp.`id_cart` = 8295AND p.`id_product` IS NOT NULLGROUP BY unique_idORDER BY cp.date_add ASC; We were trying to set almost all of the DB server parametrs, but without success, only killing apache / mysql helps for a few minutes. I checked that this problem exist when customers try to operate on a cart and adding groupon discount codes. Do you have any suggestion for this problem? Does Presta 1.6 better handle mysql queries? Link to comment Share on other sites More sharing options...
shacker Posted November 5, 2014 Share Posted November 5, 2014 its better 1.6, how big is your store? Link to comment Share on other sites More sharing options...
domel Posted November 6, 2014 Author Share Posted November 6, 2014 (edited) About 500 products. Already we have solved the problem. Tables ps_customization and ps_customized_data was just too big (400k and 800k of records). Edited November 6, 2014 by domel (see edit history) Link to comment Share on other sites More sharing options...
shacker Posted November 6, 2014 Share Posted November 6, 2014 use our free module delete connections to optimize your database Link to comment Share on other sites More sharing options...
vekia Posted November 6, 2014 Share Posted November 6, 2014 you can find these modules in free modules list you can find there addons from several community members, also addons from shacker. Link to comment Share on other sites More sharing options...
Recommended Posts