{ "query_block": { "select_id": 1, "nested_loop": [ { "table": { "table_name": "p_shop", "access_type": "ALL", "possible_keys": ["PRIMARY"], "rows": 23474, "filtered": 75, "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"], "rows": 1, "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"], "rows": 1, "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"], "rows": 1, "filtered": 100, "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"], "rows": 4, "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"], "rows": 1, "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"], "rows": 1, "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"], "rows": 1, "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"], "rows": 1, "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"], "rows": 1, "filtered": 100, "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, "nested_loop": [ { "table": { "table_name": "c", "access_type": "range", "possible_keys": ["PRIMARY", "nleftrightactive", "nright"], "key": "nright", "key_length": "4", "used_key_parts": ["nright"], "rows": 49, "filtered": 100, "index_condition": "c.nright <= 100", "attached_condition": "c.nleft >= 3" } } ] } }, { "expression_cache": { "state": "uninitialized", "query_block": { "select_id": 2, "nested_loop": [ { "read_sorted_file": { "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", "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"], "rows": 1, "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 } } } } ] } } } ] } }