{ "query_optimization": { "r_total_time_ms": 0.497451793 }, "query_block": { "select_id": 1, "r_loops": 1, "r_total_time_ms": 1264.471059, "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.2016299, "r_other_time_ms": 4.11699285, "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": 27.96537161, "r_other_time_ms": 0.881336437, "r_engine_stats": { "pages_accessed": 193 }, "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": 33.16536641, "r_other_time_ms": 4.122246076, "r_engine_stats": { "pages_accessed": 84 }, "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": 33.33468067, "r_other_time_ms": 10.45999622, "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.6748237, "r_other_time_ms": 18.6054326, "r_engine_stats": { "pages_accessed": 4820 }, "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.002661162, "r_other_time_ms": 0.003078474, "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": 196.4580541, "r_other_time_ms": 46.62755232, "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.002283853, "r_other_time_ms": 0.003192121, "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"], "key": "product_sqlstock", "key_length": "8", "used_key_parts": ["id_product", "id_product_attribute"], "ref": ["aaa_prm_test.p_shop.id_product", "func"], "r_loops": 75162, "rows": 1, "r_rows": 1, "r_table_time_ms": 271.2726691, "r_other_time_ms": 49.95449104, "r_engine_stats": { "pages_accessed": 12562, "pages_read_count": 94, "pages_read_time_ms": 32206.314 }, "filtered": 100, "r_filtered": 37.09720337, "index_condition": "stock_0.id_product_attribute = ifnull(pas.id_product_attribute,0)", "attached_condition": "stock_0.quantity > 0" } } ], "subqueries": [ { "query_block": { "select_id": 3, "r_loops": 1, "r_total_time_ms": 0.162961842, "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.141142497, "r_other_time_ms": 0.018232641, "r_engine_stats": { "pages_accessed": 3 }, "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": 406.1980725, "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": 275.6238087, "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": 123.4997982, "r_other_time_ms": 11.84809806, "r_engine_stats": { "pages_accessed": 122176 }, "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 } } } } ] } } } ] } }