Query time 0.00729
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "63.57"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "shared_descr",
"access_type": "system",
"possible_keys": [
"PRIMARY",
"product_id",
"company_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": "4K"
},
"used_columns": [
"product_id",
"lang_code",
"company_id",
"product"
]
}
},
{
"table": {
"table_name": "companies",
"access_type": "range",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"company_id"
],
"key_length": "4",
"rows_examined_per_scan": 2,
"rows_produced_per_join": 1,
"filtered": "50.00",
"index_condition": "(`test_uchur_k`.`companies`.`company_id` <> 2)",
"cost_info": {
"read_cost": "1.31",
"eval_cost": "0.10",
"prefix_cost": "1.41",
"data_read_per_join": "6K"
},
"used_columns": [
"company_id",
"status",
"company"
],
"attached_condition": "(`test_uchur_k`.`companies`.`status` = 'A')"
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"rows_examined_per_scan": 176,
"rows_produced_per_join": 176,
"filtered": "100.00",
"using_index": true,
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "18.95",
"eval_cost": "17.60",
"prefix_cost": "37.96",
"data_read_per_join": "2K"
},
"used_columns": [
"product_id",
"category_id"
],
"attached_condition": "(`test_uchur_k`.`products_categories`.`category_id` in (54,55,56,57,58,59,62,63,64,68,69,71,72,73,74,75,76,96,97,98,101,102,103,104,105,106,114,122,130,131,135,136,137,138,139,140,141,142,143,147,148,149,151,155,156,157,160,161,162,169,177,178,179,180,181,187,200,210,219,221,222,228,230,236,239,240,241,242,245,247,252,253,264,265,266,268,269,283,284,286,287,289,291,292,293,294,298,304,305,307,316,320,321,323,324,331,332,336,341,346,347,353,360,374,375,381,385,386,388))"
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"test_uchur_k.products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 8,
"filtered": "5.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.88",
"prefix_cost": "55.56",
"data_read_per_join": "46K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "(((`test_uchur_k`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`test_uchur_k`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`test_uchur_k`.`cscart_categories`.`usergroup_ids`))) and (`test_uchur_k`.`cscart_categories`.`status` in ('A','H')) and (`test_uchur_k`.`cscart_categories`.`storefront_id` in (0,1)))"
}
},
{
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"status",
"idx_parent_product_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"test_uchur_k.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "5.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.04",
"prefix_cost": "56.44",
"data_read_per_join": "4K"
},
"used_columns": [
"product_id",
"product_type",
"status",
"company_id",
"amount",
"usergroup_ids",
"tracking",
"parent_product_id",
"is_stock_split_by_warehouses"
],
"attached_condition": "((`test_uchur_k`.`products`.`company_id` = `test_uchur_k`.`companies`.`company_id`) and (`test_uchur_k`.`products`.`parent_product_id` = 0) and ((`test_uchur_k`.`products`.`usergroup_ids` = '') or (0 <> find_in_set(0,`test_uchur_k`.`products`.`usergroup_ids`)) or (0 <> find_in_set(1,`test_uchur_k`.`products`.`usergroup_ids`))) and (`test_uchur_k`.`products`.`status` = 'A'))"
}
},
{
"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": [
"test_uchur_k.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.04",
"prefix_cost": "56.49",
"data_read_per_join": "2K"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
},
{
"table": {
"table_name": "prices",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"key": "product_id",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"test_uchur_k.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "75.77",
"cost_info": {
"read_cost": "0.11",
"eval_cost": "0.03",
"prefix_cost": "56.64",
"data_read_per_join": "8"
},
"used_columns": [
"product_id",
"lower_limit",
"usergroup_id"
],
"attached_condition": "((`test_uchur_k`.`prices`.`lower_limit` = 1) and (`test_uchur_k`.`prices`.`usergroup_id` in (0,0,1)))"
}
},
{
"table": {
"table_name": "img_links",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"object_id"
],
"key": "object_id",
"used_key_parts": [
"object_id",
"object_type",
"type"
],
"key_length": "81",
"ref": [
"test_uchur_k.products_categories.product_id",
"const",
"const"
],
"rows_examined_per_scan": 4,
"rows_produced_per_join": 1,
"filtered": "100.00",
"index_condition": "(`test_uchur_k`.`img_links`.`object_id` = `test_uchur_k`.`products_categories`.`product_id`)",
"cost_info": {
"read_cost": "0.33",
"eval_cost": "0.13",
"prefix_cost": "57.11",
"data_read_per_join": "128"
},
"used_columns": [
"pair_id",
"object_id",
"object_type",
"type"
],
"attached_condition": "(`test_uchur_k`.`img_links`.`pair_id` > 0)"
}
},
{
"table": {
"table_name": "war_sum_amount",
"access_type": "ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"test_uchur_k.products_categories.product_id"
],
"rows_examined_per_scan": 15,
"rows_produced_per_join": 20,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.46",
"eval_cost": "2.00",
"prefix_cost": "59.57",
"data_read_per_join": "320"
},
"used_columns": [
"product_id"
]
}
},
{
"table": {
"table_name": "warehouses_destination_products_amount",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"idx_storefront_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id",
"destination_id",
"storefront_id"
],
"key_length": "9",
"ref": [
"test_uchur_k.products_categories.product_id",
"const",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 20,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "2.00",
"prefix_cost": "61.57",
"data_read_per_join": "320"
},
"used_columns": [
"destination_id",
"storefront_id",
"product_id",
"amount"
],
"attached_condition": "<if>(found_match(warehouses_destination_products_amount), (((case `test_uchur_k`.`products`.`is_stock_split_by_warehouses` when 'Y' then `test_uchur_k`.`warehouses_destination_products_amount`.`amount` else `test_uchur_k`.`products`.`amount` end) > 0) or (`test_uchur_k`.`products`.`tracking` = 'D')), true)"
}
},
{
"table": {
"table_name": "popularity",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"total"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"test_uchur_k.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 20,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "2.00",
"prefix_cost": "63.57",
"data_read_per_join": "640"
},
"used_columns": [
"product_id",
"total"
]
}
}
]
}
}
}
}
Result
| product_id |
product |
company_name |
product_type |
parent_product_id |
| 51050 |
Фонарь Armytek Predator Pro Magnet USB Теплый |
UCHUR(Астана) |
P |
0 |
| 51009 |
Выносная магнитная кнопка Armytek MRS-02C |
UCHUR(Астана) |
P |
0 |
| 51034 |
Фонарь Fenix HL40R синий |
UCHUR(Астана) |
P |
0 |
| 51061 |
Зарядное устройство Armytek Uni C2 Plug Type C |
UCHUR(Астана) |
P |
0 |
| 51426 |
Свисток на свиязя «Лыйыр» |
UCHUR(Астана) |
P |
0 |
| 51052 |
Фонарь Armytek Predator Pro Max Magnet USB Белый |
UCHUR(Астана) |
P |
0 |
| 51064 |
Зарядное устройство Armytek Handy C1 VE |
UCHUR(Астана) |
P |
0 |
| 51068 |
Фильтр для фонаря красный Armytek Red Filter AF-39 (Predator/Viking) |
UCHUR(Астана) |
P |
0 |
| 51055 |
Фонарь Armytek Dobermann Pro Magnet USB Теплый |
UCHUR(Астана) |
P |
0 |
| 51071 |
Выносная магнитная кнопка Armytek Magnetic MRS-01 |
UCHUR(Астана) |
P |
0 |
| 51058 |
Фонарь Armytek Barracuda Pro Max Magnet USB Белый |
UCHUR(Астана) |
P |
0 |