{ "query_optimization": { "r_total_time_ms": 0.508372831 }, "query_block": { "select_id": 1, "r_loops": 1, "r_total_time_ms": 23388.17413, "nested_loop": [ { "table": { "table_name": "p_shop", "access_type": "ALL", "possible_keys": ["PRIMARY"], "r_loops": 1, "rows": 23474, "r_rows": 23663, "r_table_time_ms": 8.196184837, "r_other_time_ms": 4.506308918, "r_engine_stats": { "pages_accessed": 243 }, "filtered": 75, "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": ["aaa_prm_test.p_shop.id_product"], "r_loops": 10590, "rows": 1, "r_rows": 1, "r_table_time_ms": 25.06183946, "r_other_time_ms": 0.938056369, "r_engine_stats": { "pages_accessed": 534 }, "filtered": 100, "r_filtered": 100, "using_index": true } }, { "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": ["aaa_prm_test.p_shop.id_product"], "r_loops": 10590, "rows": 1, "r_rows": 2.976109537, "r_table_time_ms": 31.64407737, "r_other_time_ms": 4.555595418, "r_engine_stats": { "pages_accessed": 1024 }, "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": ["aaa_prm_test.cpro_p.id_category", "const"], "r_loops": 31517, "rows": 1, "r_rows": 1, "r_table_time_ms": 27.96371963, "r_other_time_ms": 12.35682456, "r_engine_stats": {}, "filtered": 100, "r_filtered": 35.47291938, "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", "using_index": true } }, { "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": ["aaa_prm_test.p_shop.id_product", "const"], "r_loops": 11180, "rows": 4, "r_rows": 6.68059034, "r_table_time_ms": 110.2849994, "r_other_time_ms": 19.43466772, "r_engine_stats": { "pages_accessed": 7573 }, "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": ["aaa_prm_test.p_shop.id_tax_rules_group"], "r_loops": 75162, "rows": 1, "r_rows": 1, "r_table_time_ms": 0.001862904, "r_other_time_ms": 0.002822995, "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)", "using_index": true } }, { "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": ["aaa_prm_test.trg.id_tax_rules_group", "const", "const"], "r_loops": 75162, "rows": 1, "r_rows": 1, "r_table_time_ms": 172.8480362, "r_other_time_ms": 49.30686226, "r_engine_stats": {}, "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": ["aaa_prm_test.tr.id_tax"], "r_loops": 75162, "rows": 1, "r_rows": 1, "r_table_time_ms": 0.002038375, "r_other_time_ms": 0.002471144, "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"], "r_loops": 75162, "rows": 1, "r_rows": 0, "r_engine_stats": {}, "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"], "r_loops": 75162, "rows": 1, "r_rows": 149.9067082, "r_table_time_ms": 21886.14026, "r_other_time_ms": 582.7895252, "r_engine_stats": { "pages_accessed": 89128 }, "filtered": 100, "r_filtered": 0.247468601, "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" } } ], "subqueries": [ { "query_block": { "select_id": 3, "r_loops": 1, "r_total_time_ms": 0.083436107, "nested_loop": [ { "table": { "table_name": "c", "access_type": "range", "possible_keys": ["PRIMARY", "nleftrightactive", "nright"], "key": "nright", "key_length": "4", "used_key_parts": ["nright"], "r_loops": 1, "rows": 49, "r_rows": 49, "r_table_time_ms": 0.063634226, "r_other_time_ms": 0.016287001, "r_engine_stats": { "pages_accessed": 99 }, "filtered": 100, "r_filtered": 100, "index_condition": "c.nright <= 100", "attached_condition": "c.nleft >= 3" } } ] } }, { "expression_cache": { "state": "uninitialized", "r_loops": 0, "query_block": { "select_id": 2, "r_loops": 75162, "r_total_time_ms": 411.9366194, "nested_loop": [ { "read_sorted_file": { "r_rows": 0, "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": 75162, "r_total_time_ms": 278.5172381, "r_limit": 1, "r_used_priority_queue": true, "r_output_rows": 0, "r_sort_mode": "sort_key,addon_fields", "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": ["aaa_prm_test.p.id_product", "const"], "r_loops": 75162, "rows": 1, "r_rows": 0, "r_table_time_ms": 124.1780808, "r_other_time_ms": 12.25572405, "r_engine_stats": { "pages_accessed": 122642 }, "filtered": 100, "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 } } } } ] } } } ] } }