Query time 0.00234
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "25.28"
},
"ordering_operation": {
"using_filesort": false,
"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": "variation_group_products",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"idx_group_id"
],
"key": "idx_group_id",
"used_key_parts": [
"group_id"
],
"key_length": "3",
"rows_examined_per_scan": 29,
"rows_produced_per_join": 29,
"filtered": "100.00",
"index_condition": "(`test_uchur_k`.`variation_group_products`.`group_id` in (243,237,244,241,239,242))",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "11.66",
"eval_cost": "2.90",
"prefix_cost": "15.97",
"data_read_per_join": "464"
},
"used_columns": [
"product_id",
"group_id"
]
}
},
{
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"status"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"test_uchur_k.variation_group_products.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 2,
"filtered": "8.92",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.26",
"prefix_cost": "18.87",
"data_read_per_join": "27K"
},
"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`.`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.variation_group_products.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 2,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.26",
"prefix_cost": "19.13",
"data_read_per_join": "11K"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"test_uchur_k.variation_group_products.product_id"
],
"rows_examined_per_scan": 2,
"rows_produced_per_join": 5,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.29",
"eval_cost": "0.52",
"prefix_cost": "20.94",
"data_read_per_join": "82"
},
"used_columns": [
"product_id",
"category_id"
]
}
},
{
"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": 0,
"filtered": "5.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.03",
"prefix_cost": "21.46",
"data_read_per_join": "1K"
},
"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": "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.variation_group_products.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`.`variation_group_products`.`product_id`)",
"cost_info": {
"read_cost": "0.26",
"eval_cost": "0.10",
"prefix_cost": "21.82",
"data_read_per_join": "99"
},
"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.variation_group_products.product_id"
],
"rows_examined_per_scan": 15,
"rows_produced_per_join": 15,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.36",
"eval_cost": "1.55",
"prefix_cost": "23.73",
"data_read_per_join": "248"
},
"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.variation_group_products.product_id",
"const",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 15,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "1.55",
"prefix_cost": "25.28",
"data_read_per_join": "248"
},
"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)"
}
}
]
}
}
}
}
Result
| product_id |
amount |
product |
company_name |
variation_group_id |
product_type |
parent_product_id |
| 65 |
1 |
Жилет стеганый "BULCHUT" тк.Nylon Taslan Dobby цв.Черный |
UCHUR(Астана) |
237 |
P |
0 |
| 50992 |
6 |
Жилет мужской UL Down vest RX24-354D цв. Серый |
UCHUR(Астана) |
239 |
P |
0 |
| 51374 |
6 |
Жилет мужской UL Down vest RX24-354D цв. Серый |
UCHUR(Астана) |
239 |
V |
50992 |
| 51375 |
6 |
Жилет мужской UL Down vest RX24-354D цв. Серый |
UCHUR(Астана) |
239 |
V |
50992 |
| 50993 |
6 |
Жилет мужской RX24-366D цв. Синий |
UCHUR(Астана) |
241 |
P |
0 |
| 51381 |
6 |
Жилет мужской RX24-366D цв. Синий |
UCHUR(Астана) |
241 |
V |
50993 |
| 51382 |
6 |
Жилет мужской RX24-366D цв. Синий |
UCHUR(Астана) |
241 |
V |
50993 |
| 51384 |
6 |
Жилет женский RX24-364D цв. Синий |
UCHUR(Астана) |
242 |
P |
0 |
| 140 |
7 |
Жилет UCHUR WEAVE CORE цв. Черный |
UCHUR(Астана) |
243 |
P |
0 |
| 51385 |
10 |
Жилет UCHUR WEAVE CORE цв. Черный |
UCHUR(Астана) |
243 |
V |
140 |
| 51386 |
9 |
Жилет UCHUR WEAVE CORE цв. Черный |
UCHUR(Астана) |
243 |
V |
140 |
| 51387 |
9 |
Жилет UCHUR WEAVE CORE цв. Черный |
UCHUR(Астана) |
243 |
V |
140 |
| 51388 |
5 |
Жилет UCHUR WEAVE CORE цв. Черный |
UCHUR(Астана) |
243 |
V |
140 |
| 51389 |
5 |
Жилет UCHUR WEAVE CORE цв. Черный |
UCHUR(Астана) |
243 |
V |
140 |
| 89 |
8 |
Жилет UCHUR WEAVE CORE цв. Серый |
UCHUR(Астана) |
244 |
P |
0 |
| 51390 |
8 |
Жилет UCHUR WEAVE CORE цв. Серый |
UCHUR(Астана) |
244 |
V |
89 |
| 51391 |
6 |
Жилет UCHUR WEAVE CORE цв. Серый |
UCHUR(Астана) |
244 |
V |
89 |
| 51392 |
7 |
Жилет UCHUR WEAVE CORE цв. Серый |
UCHUR(Астана) |
244 |
V |
89 |
| 51393 |
3 |
Жилет UCHUR WEAVE CORE цв. Серый |
UCHUR(Астана) |
244 |
V |
89 |
| 51394 |
1 |
Жилет UCHUR WEAVE CORE цв. Серый |
UCHUR(Астана) |
244 |
V |
89 |