Chill_user Posted February 14, 2020 Share Posted February 14, 2020 Hello to all, I have an painfull situation during "payment" process. I have about 10'000 queries running and 90% of them are CartRule.php class About cartrules in BO: 39 cart rules active. PS: 1.7.5.2 Can somebody provide some help? Thank you Link to comment Share on other sites More sharing options...
joseantgv Posted February 17, 2020 Share Posted February 17, 2020 Could you paste the query executed 10.000 times? Link to comment Share on other sites More sharing options...
Chill_user Posted February 17, 2020 Author Share Posted February 17, 2020 (edited) Stopwatch SQL - 17911 queries I noticed few queries is repeating but this one is repeating most times: SELECT SQL_NO_CACHE * FROM uhep_cart_rule_product_rule pr LEFT JOIN uhep_cart_rule_product_rule_value prv ON pr.id_product_rule = prv.id_product_rule WHERE pr.id_product_rule_group = 224 Path: /classes/CartRule.php:606, here is the function in CartRule.php: public function getProductRules($id_product_rule_group) { if (!Validate::isLoadedObject($this) || $this->product_restriction == 0) { return array(); } $productRules = array(); $results = Db::getInstance()->executeS(' SELECT * FROM ' . _DB_PREFIX_ . 'cart_rule_product_rule pr LEFT JOIN ' . _DB_PREFIX_ . 'cart_rule_product_rule_value prv ON pr.id_product_rule = prv.id_product_rule WHERE pr.id_product_rule_group = ' . (int) $id_product_rule_group); foreach ($results as $row) { if (!isset($productRules[$row['id_product_rule']])) { $productRules[$row['id_product_rule']] = array('type' => $row['type'], 'values' => array()); } $productRules[$row['id_product_rule']]['values'][] = $row['id_item']; } return $productRules; } I really dont understand why this function is repeating but: IF I delete all cart rules, it runs about 3000 queries instead of 10'000-15'000 queries Edited February 17, 2020 by Amantha Bill (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now