+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ANALYZE | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | { "query_optimization": { "r_total_time_ms": 6.215211143 }, "query_block": { "select_id": 1, "cost": 1637.776452, "r_loops": 1, "r_total_time_ms": 121017.2741, "nested_loop": [ { "table": { "table_name": "p_shop", "access_type": "ALL", "possible_keys": ["PRIMARY"], "loops": 1, "r_loops": 1, "rows": 23474, "r_rows": 23663, "cost": 4.0832992, "r_table_time_ms": 31.61279579, "r_other_time_ms": 39.13427366, "r_engine_stats": { "pages_accessed": 243 }, "filtered": 100, "r_filtered": 44.7534125, "attached_condition": "p_shop.active = 1 and p_shop.id_shop = 1 and p_shop.visibility in ('both','catalog')" } }, { "table": { "table_name": "p", "access_type": "eq_ref", "possible_keys": ["PRIMARY"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["id_product"], "ref": ["aaaaa.p_shop.id_product"], "loops": 23474, "r_loops": 10590, "rows": 1, "r_rows": 1, "cost": 21.33769096, "r_table_time_ms": 55.42727784, "r_other_time_ms": 4.751351458, "r_engine_stats": { "pages_accessed": 21506 }, "filtered": 100, "r_filtered": 100 } }, { "table": { "table_name": "pas", "access_type": "ref", "possible_keys": ["id_product"], "key": "id_product", "key_length": "8", "used_key_parts": ["id_product", "id_shop"], "ref": ["aaaaa.p_shop.id_product", "const"], "loops": 23474, "r_loops": 10590, "rows": 10, "r_rows": 6.552691218, "cost": 253.7509533, "r_table_time_ms": 247.7522066, "r_other_time_ms": 56.50126683, "r_engine_stats": { "pages_accessed": 229496 }, "filtered": 100, "r_filtered": 100 } }, { "table": { "table_name": "trg", "access_type": "eq_ref", "possible_keys": ["PRIMARY"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["id_tax_rules_group"], "ref": ["aaaaa.p_shop.id_tax_rules_group"], "loops": 234740, "r_loops": 71236, "r_table_loops": 1, "rows": 1, "r_rows": 1, "cost": 27.75741576, "r_table_time_ms": 0.024500178, "r_other_time_ms": 0.03490327, "r_engine_stats": { "pages_accessed": 1 }, "filtered": 100, "r_filtered": 100, "attached_condition": "trigcond(trg.id_tax_rules_group = p_shop.id_tax_rules_group)" } }, { "table": { "table_name": "tr", "access_type": "ref", "possible_keys": ["id_tax_rules_group", "category_getproducts"], "key": "category_getproducts", "key_length": "12", "used_key_parts": ["id_tax_rules_group", "id_country", "id_state"], "ref": ["aaaaa.trg.id_tax_rules_group", "const", "const"], "loops": 234740, "r_loops": 71236, "rows": 1, "r_rows": 1, "cost": 427.2659968, "r_table_time_ms": 235.628507, "r_other_time_ms": 152.1913068, "r_engine_stats": { "pages_accessed": 142472 }, "filtered": 100, "r_filtered": 100, "attached_condition": "trigcond(tr.zipcode_from = 0 and trigcond(trg.id_tax_rules_group is not null))" } }, { "table": { "table_name": "t", "access_type": "eq_ref", "possible_keys": ["PRIMARY"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["id_tax"], "ref": ["aaaaa.tr.id_tax"], "loops": 234740, "r_loops": 71236, "r_table_loops": 1, "rows": 1, "r_rows": 1, "cost": 209.9616648, "r_table_time_ms": 0.02156879, "r_other_time_ms": 0.021477661, "r_engine_stats": { "pages_accessed": 1 }, "filtered": 100, "r_filtered": 100, "attached_condition": "trigcond(t.id_tax = tr.id_tax and trigcond(tr.id_tax is not null))" } }, { "table": { "table_name": "sp", "access_type": "eq_ref", "possible_keys": ["PRIMARY", "id_product_2", "id_product"], "key": "PRIMARY", "key_length": "4", "used_key_parts": ["id_specific_price"], "ref": ["func"], "loops": 234740, "r_loops": 71236, "r_table_loops": 259, "rows": 1, "r_rows": 0.040836094, "cost": 27.77216136, "r_table_time_ms": 0.873363976, "r_other_time_ms": 0.411288615, "r_engine_stats": { "pages_accessed": 521 }, "filtered": 100, "r_filtered": 100, "attached_condition": "trigcond(sp.id_product = p_shop.id_product and sp.id_specific_price = (subquery#2))" } }, { "table": { "table_name": "stock_0", "access_type": "ref", "possible_keys": [ "product_sqlstock", "id_product", "id_product_attribute", "quantity" ], "key": "id_product_attribute", "key_length": "4", "used_key_parts": ["id_product_attribute"], "ref": ["func"], "loops": 234740, "r_loops": 71236, "rows": 1, "r_rows": 613.1773541, "cost": 427.9287296, "r_table_time_ms": 110906.1382, "r_other_time_ms": 7640.636855, "r_engine_stats": { "pages_accessed": 87538222 }, "filtered": 34.83435059, "r_filtered": 0.065194146, "index_condition": "stock_0.id_product_attribute = ifnull(pas.id_product_attribute,0)", "attached_condition": "stock_0.id_product = p_shop.id_product and stock_0.quantity > 0" } }, { "table": { "table_name": "cpro_p", "access_type": "ref", "possible_keys": ["PRIMARY", "id_product", "id_category"], "key": "id_product", "key_length": "4", "used_key_parts": ["id_product"], "ref": ["aaaaa.p_shop.id_product"], "loops": 81770.15582, "r_loops": 28477, "rows": 2, "r_rows": 3.116866243, "cost": 91.64072423, "r_table_time_ms": 123.2527907, "r_other_time_ms": 31.15536278, "r_engine_stats": { "pages_accessed": 57123 }, "filtered": 100, "r_filtered": 100, "using_index": true } }, { "table": { "table_name": "cshop_p", "access_type": "eq_ref", "possible_keys": ["PRIMARY"], "key": "PRIMARY", "key_length": "8", "used_key_parts": ["id_category", "id_shop"], "ref": ["aaaaa.cpro_p.id_category", "const"], "loops": 163540.3116, "r_loops": 88759, "r_table_loops": 88633, "rows": 1, "r_rows": 1, "cost": 146.2778155, "r_table_time_ms": 151.8435704, "r_other_time_ms": 174.9636047, "r_engine_stats": { "pages_accessed": 88633 }, "filtered": 100, "r_filtered": 31.41427912, "attached_condition": "(cshop_p.id_category = 12 or (cshop_p.id_category,cshop_p.id_category in (subquery#3))) and cshop_p.id_category = cpro_p.id_category" } } ], "subqueries": [ { "query_block": { "select_id": 3, "cost": 0.00171364, "r_loops": 1, "r_total_time_ms": 0.822515751, "nested_loop": [ { "table": { "table_name": "c", "access_type": "range", "possible_keys": ["PRIMARY", "nleftrightactive", "nright"], "key": "nleftrightactive", "key_length": "4", "used_key_parts": ["nleft"], "loops": 1, "r_loops": 1, "rows": 302, "r_rows": 302, "cost": 0.04673591, "r_table_time_ms": 0.321242722, "r_other_time_ms": 0.467468539, "r_engine_stats": { "pages_accessed": 1 }, "filtered": 16.11842155, "r_filtered": 16.22516556, "attached_condition": "c.nleft >= 3 and c.nright <= 100", "using_index": true } } ] } }, { "expression_cache": { "state": "disabled", "r_loops": 0, "query_block": { "select_id": 2, "cost": 0.001792605, "r_loops": 77054, "r_total_time_ms": 1096.234487, "nested_loop": [ { "read_sorted_file": { "r_rows": 0.113258234, "filesort": { "sort_key": "spc.from_quantity desc, if(spc.id_group = 3,2,0) + if(spc.id_country = 37,4,0) + if(spc.id_currency = 1,8,0) + if(spc.id_shop = 1,16,0) + if(spc.id_customer = 0,32,0) desc, spc.`to` desc, spc.`from` desc", "r_loops": 77054, "r_total_time_ms": 691.488138, "r_limit": 1, "r_used_priority_queue": true, "r_output_rows": 0, "r_sort_mode": "sort_key,rowid", "table": { "table_name": "spc", "access_type": "ref", "possible_keys": [ "id_product_2", "id_product", "id_product_attribute", "id_shop", "from", "to" ], "key": "id_product_2", "key_length": "8", "used_key_parts": ["id_product", "id_product_attribute"], "ref": ["aaaaa.p.id_product", "const"], "loops": 1, "r_loops": 77054, "rows": 1, "r_rows": 0.113258234, "cost": 0.001792605, "r_table_time_ms": 206.8576193, "r_other_time_ms": 66.63701353, "r_engine_stats": { "pages_accessed": 171900 }, "filtered": 99.92241669, "r_filtered": 100, "attached_condition": "spc.id_product <=> p.id_product and spc.id_product_attribute <=> 0 and spc.id_shop in (0,1) and spc.id_currency in (0,1) and spc.id_country in (0,37) and spc.id_group in (0,3) and (spc.`from` = TIMESTAMP'0000-00-00 00:00:00' or '2022-05-31 23:12:00' >= spc.`from`) and (spc.`to` = TIMESTAMP'0000-00-00 00:00:00' or '2022-05-31 23:12:00' <= spc.`to`)", "using_index": true } } } } ] } } } ] } } | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (2 min 0.971 sec)