Query time 0.00421
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "3.00"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"buffer_result": {
"using_temporary_table": true,
"nested_loop": [
{
"table": {
"table_name": "master_products_storefront_offers_count",
"access_type": "system",
"possible_keys": [
"PRIMARY",
"idx_storefront_id"
],
"rows_examined_per_scan": 0,
"rows_produced_per_join": 1,
"filtered": "0.00",
"const_row_not_found": true,
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.10",
"prefix_cost": "0.00",
"data_read_per_join": "16"
},
"used_columns": [
"storefront_id",
"product_id",
"count"
]
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"rows_examined_per_scan": 4,
"rows_produced_per_join": 0,
"filtered": "4.00",
"index_condition": "(`kcoffee`.`cscart_categories`.`category_id` in (302,311,312,313))",
"cost_info": {
"read_cost": "2.79",
"eval_cost": "0.02",
"prefix_cost": "2.81",
"data_read_per_join": "512"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "(((`kcoffee`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`kcoffee`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`kcoffee`.`cscart_categories`.`usergroup_ids`))) and (`kcoffee`.`cscart_categories`.`status` in ('A','H')) and (`kcoffee`.`cscart_categories`.`storefront_id` in (0,1)))"
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"kcoffee.cscart_categories.category_id"
],
"rows_examined_per_scan": 2,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.08",
"eval_cost": "0.03",
"prefix_cost": "2.92",
"data_read_per_join": "5"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
},
{
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"status",
"idx_master_product_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"kcoffee.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "17.34",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.01",
"prefix_cost": "2.95",
"data_read_per_join": "252"
},
"used_columns": [
"product_id",
"product_type",
"status",
"company_id",
"usergroup_ids",
"parent_product_id",
"master_product_id",
"master_product_status",
"master_product_offers_count"
],
"attached_condition": "((`kcoffee`.`products`.`master_product_id` = 0) and ((`kcoffee`.`products`.`usergroup_ids` = '') or (0 <> find_in_set(0,`kcoffee`.`products`.`usergroup_ids`)) or (0 <> find_in_set(1,`kcoffee`.`products`.`usergroup_ids`))) and (`kcoffee`.`products`.`status` = 'A') and (`kcoffee`.`products`.`master_product_status` in ('A','H')) and ((`kcoffee`.`products`.`company_id` > 0) or <cache>((NULL > 0))) and (`kcoffee`.`products`.`product_type` <> 'D'))"
}
},
{
"table": {
"table_name": "companies",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"company_id"
],
"key_length": "4",
"ref": [
"kcoffee.products.company_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.01",
"prefix_cost": "2.96",
"data_read_per_join": "353"
},
"used_columns": [
"company_id",
"status",
"company",
"city",
"state",
"country"
],
"attached_condition": "<if>(found_match(companies), ((`kcoffee`.`companies`.`status` = 'A') or (`kcoffee`.`products`.`company_id` = 0)), true)"
}
},
{
"table": {
"table_name": "descr1",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"product_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id",
"lang_code"
],
"key_length": "9",
"ref": [
"kcoffee.products_categories.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.01",
"prefix_cost": "2.97",
"data_read_per_join": "259"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
},
{
"table": {
"table_name": "abt_erp_cities",
"access_type": "eq_ref",
"possible_keys": [
"cs",
"state_code",
"code",
"country_code"
],
"key": "cs",
"used_key_parts": [
"country_code",
"state_code",
"code"
],
"key_length": "204",
"ref": [
"kcoffee.companies.country",
"kcoffee.companies.state",
"kcoffee.companies.city"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.01",
"prefix_cost": "2.97",
"data_read_per_join": "12"
},
"used_columns": [
"city_id",
"state_code",
"country_code",
"code",
"status"
],
"attached_condition": "<if>(is_not_null_compl(abt_erp_cities), ((`kcoffee`.`abt_erp_cities`.`code` = `kcoffee`.`companies`.`city`) and (`kcoffee`.`abt_erp_cities`.`country_code` = `kcoffee`.`companies`.`country`) and (`kcoffee`.`abt_erp_cities`.`status` = 'A')), true)"
}
},
{
"table": {
"table_name": "abt_erp_city_descr",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"city_id",
"lang_code"
],
"key_length": "9",
"ref": [
"kcoffee.abt_erp_cities.city_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.01",
"prefix_cost": "2.98",
"data_read_per_join": "43"
},
"used_columns": [
"city_id",
"lang_code",
"city"
]
}
},
{
"table": {
"table_name": "abt_erp_country_descr",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"code",
"lang_code"
],
"key_length": "12",
"ref": [
"kcoffee.companies.country",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.01",
"prefix_cost": "2.98",
"data_read_per_join": "22"
},
"used_columns": [
"code",
"lang_code",
"country"
]
}
},
{
"table": {
"table_name": "prices",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"key": "usergroup",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"kcoffee.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "99.26",
"using_index": true,
"cost_info": {
"read_cost": "0.01",
"eval_cost": "0.01",
"prefix_cost": "3.00",
"data_read_per_join": "1"
},
"used_columns": [
"product_id",
"lower_limit",
"usergroup_id"
],
"attached_condition": "((`kcoffee`.`prices`.`lower_limit` = 1) and (`kcoffee`.`prices`.`usergroup_id` in (0,0,1)))"
}
}
]
}
}
}
}
}
Result
| product_id |
product |
company_name |
product_ids |
product_types |
parent_product_ids |
product_type |
parent_product_id |
master_product_offers_count |
master_product_id |
company_id |
abt__ut2_mv_company_city |
abt__ut2_mv_company_country |
| 363 |
TIÊU XANH SẤY LẠNH K PEPPER 26 G + CỐI XAY TIÊU |
K COFFEE |
363 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 359 |
TIÊU ĐEN K PEPPER 50 G + CỐI XAY TIÊU |
K COFFEE |
359 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 361 |
TIÊU TRẮNG K PEPPER 51 G + CỐI XAY TIÊU |
K COFFEE |
361 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 364 |
TIÊU BỐN MÙA K PEPPER 50 G + CỐI XAY TIÊU |
K COFFEE |
364 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 360 |
TIÊU ĐEN K PEPPER 90 G + CỐI XAY TIÊU |
K COFFEE |
360 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 362 |
TIÊU TRẮNG K PEPPER 90 G + CỐI XAY TIÊU |
K COFFEE |
362 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 365 |
TIÊU BỐN MÙA K PEPPER 70 G + CỐI XAY TIÊU |
K COFFEE |
365 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 367 |
TIÊU ĐEN K PEPPER 85 G - TIÊU SẠCH NGUYÊN CHẤT |
K COFFEE |
367 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 366 |
TIÊU ĐEN K PEPPER 125 G - TIÊU SẠCH NGUYÊN CHẤT |
K COFFEE |
366 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 369 |
TIÊU TRẮNG K PEPPER 85 G |
K COFFEE |
369 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 368 |
TIÊU TRẮNG K PEPPER 125 G |
K COFFEE |
368 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 370 |
TIÊU ĐEN HẠT K PEPPER 35 G |
K COFFEE |
370 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 371 |
TIÊU ĐEN XAY K PEPPER 35G |
K COFFEE |
371 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 345 |
Sốt Tiêu Xanh Ngâm Giấm K Pepper 130g – Chua Cay Chuẩn Vị |
K COFFEE |
345 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 346 |
Sốt Tiêu Xanh Ngâm Giấm K Pepper 180g – Chua Cay Chuẩn Vị |
K COFFEE |
346 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |
| 358 |
BỘ GIA VỊ VUA TIÊU K PEPPER |
K COFFEE |
358 |
P |
0 |
P |
0 |
0 |
0 |
3 |
Phường Cầu Ông Lãnh |
Viet Nam |