Query time 0.00161
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "28.98"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"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": 8,
"rows_produced_per_join": 0,
"filtered": "4.00",
"index_condition": "(`cscart`.`cscart_categories`.`category_id` in (392,393,394,395,396,397,398,416))",
"cost_info": {
"read_cost": "19.15",
"eval_cost": "0.06",
"prefix_cost": "19.21",
"data_read_per_join": "1K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "(((`cscart`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`cscart`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`cscart`.`cscart_categories`.`usergroup_ids`)) and (`cscart`.`cscart_categories`.`status` in ('A','H')) and (`cscart`.`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": [
"cscart.cscart_categories.category_id"
],
"rows_examined_per_scan": 12,
"rows_produced_per_join": 3,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.41",
"eval_cost": "0.77",
"prefix_cost": "20.39",
"data_read_per_join": "61"
},
"used_columns": [
"product_id",
"category_id"
]
}
},
{
"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": [
"cscart.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "41.33",
"cost_info": {
"read_cost": "3.84",
"eval_cost": "0.32",
"prefix_cost": "25.00",
"data_read_per_join": "10K"
},
"used_columns": [
"product_id",
"product_type",
"status",
"company_id",
"usergroup_ids",
"parent_product_id"
],
"attached_condition": "((`cscart`.`products`.`parent_product_id` = 0) and ((`cscart`.`products`.`usergroup_ids` = '') or find_in_set(0,`cscart`.`products`.`usergroup_ids`) or find_in_set(1,`cscart`.`products`.`usergroup_ids`)) and (`cscart`.`products`.`status` = 'A'))"
}
},
{
"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": [
"cscart.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "99.36",
"cost_info": {
"read_cost": "1.59",
"eval_cost": "0.32",
"prefix_cost": "26.90",
"data_read_per_join": "37"
},
"used_columns": [
"product_id",
"lower_limit",
"usergroup_id"
],
"attached_condition": "((`cscart`.`prices`.`lower_limit` = 1) and (`cscart`.`prices`.`usergroup_id` in (0,0,1)))"
}
},
{
"table": {
"table_name": "companies",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"company_id"
],
"key_length": "4",
"ref": [
"cscart.products.company_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "10.00",
"cost_info": {
"read_cost": "1.58",
"eval_cost": "0.03",
"prefix_cost": "28.79",
"data_read_per_join": "1K"
},
"used_columns": [
"company_id",
"status",
"company"
],
"attached_condition": "(`cscart`.`companies`.`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": [
"cscart.products_categories.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.16",
"eval_cost": "0.03",
"prefix_cost": "28.98",
"data_read_per_join": "736"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
}
]
}
}
}
}
Result
| product_id |
product |
company_name |
product_type |
parent_product_id |
| 1095 |
IN_001_0043_G1_MV1 |
Тестовый производитель |
P |
0 |
| 815 |
Письменный стол Кассия |
Тестовый производитель |
P |
0 |
| 811 |
Письменный стол правый Кассия |
Тестовый производитель |
P |
0 |
| 820 |
Письменный стол с подъемной крышкой Аллегро левый |
Тестовый производитель |
P |
0 |
| 819 |
Письменный стол Шарли |
Тестовый производитель |
P |
0 |
| 802 |
Стол обеденный раздвижной DANTE-120 |
Тестовый производитель |
P |
0 |
| 797 |
Стол обеденный раздвижной WINK-110 |
Тестовый производитель |
P |
0 |
| 796 |
Стол обеденный раздвижной Белладжио |
Тестовый производитель |
P |
0 |
| 813 |
Стол письменный левый Джелато |
Тестовый производитель |
P |
0 |
| 807 |
Стол раздвижной Фаларио |
Тестовый производитель |
P |
0 |
| 824 |
Стол туалетный Авангард |
Тестовый производитель |
P |
0 |
| 822 |
Стол туалетный Люксор Сатин |
Тестовый производитель |
P |
0 |
| 825 |
Туалетный столик с зеркалом Кассия |
Тестовый производитель |
P |
0 |
| 821 |
Туалетный столик Шарли |
Тестовый производитель |
P |
0 |