Query time 0.00247
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "16.44"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "companies",
"access_type": "system",
"possible_keys": [
"PRIMARY"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.10",
"prefix_cost": "0.00",
"data_read_per_join": "6K"
},
"used_columns": [
"company_id",
"status",
"company"
]
}
},
{
"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": "5K"
},
"used_columns": [
"product_id",
"lang_code",
"company_id",
"product"
]
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "const",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.10",
"prefix_cost": "0.00",
"data_read_per_join": "4K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
]
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"rows_examined_per_scan": 47,
"rows_produced_per_join": 47,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "5.25",
"eval_cost": "4.70",
"prefix_cost": "9.95",
"data_read_per_join": "752"
},
"used_columns": [
"product_id",
"category_id"
],
"attached_condition": "((`testdobroded`.`products_categories`.`category_id` = 54) and (`testdobroded`.`products_categories`.`product_id` <> 1187))"
}
},
{
"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": [
"testdobroded.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 2,
"filtered": "5.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.24",
"prefix_cost": "14.65",
"data_read_per_join": "23K"
},
"used_columns": [
"product_id",
"product_type",
"status",
"company_id",
"amount",
"usergroup_ids",
"tracking",
"parent_product_id"
],
"attached_condition": "((`testdobroded`.`products`.`company_id` = '1') and (`testdobroded`.`products`.`parent_product_id` = 0) and ((`testdobroded`.`products`.`amount` > 0) or (`testdobroded`.`products`.`tracking` = 'D')) and ((`testdobroded`.`products`.`usergroup_ids` = '') or (0 <> find_in_set(0,`testdobroded`.`products`.`usergroup_ids`)) or (0 <> find_in_set(1,`testdobroded`.`products`.`usergroup_ids`))) and (`testdobroded`.`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": [
"testdobroded.products_categories.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.24",
"prefix_cost": "14.88",
"data_read_per_join": "14K"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
},
{
"table": {
"table_name": "popularity",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"total"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"testdobroded.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 2,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.24",
"prefix_cost": "15.12",
"data_read_per_join": "75"
},
"used_columns": [
"product_id",
"total"
]
}
},
{
"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": [
"testdobroded.products_categories.product_id"
],
"rows_examined_per_scan": 3,
"rows_produced_per_join": 2,
"filtered": "29.98",
"using_index": true,
"cost_info": {
"read_cost": "0.62",
"eval_cost": "0.21",
"prefix_cost": "16.45",
"data_read_per_join": "50"
},
"used_columns": [
"product_id",
"lower_limit",
"usergroup_id"
],
"attached_condition": "((`testdobroded`.`prices`.`lower_limit` = 1) and (`testdobroded`.`prices`.`usergroup_id` in (0,0,1)))"
}
}
]
}
}
}
}
Result
| product_id |
product |
company_name |
product_type |
parent_product_id |
| 814 |
Мармелад из Морошки 150 гр. |
ДоброДед |
P |
0 |
| 1186 |
Чурчхела Морошка и Грецкий орех |
ДоброДед |
P |
0 |
| 343 |
Мармелад из Сосновой шишки 150 г |
ДоброДед |
P |
0 |
| 1157 |
Мармелад из Лесных ягод 150 г |
ДоброДед |
P |
0 |
| 1156 |
Мармелад из Брусники 150 г |
ДоброДед |
P |
0 |
| 1155 |
Мармелад из Черники 150 г |
ДоброДед |
P |
0 |
| 1432 |
Мармелад Ассорти (из сосновой шишки, из морошки, из черники, из брусники, из лесных ягод) 150 г |
ДоброДед |
P |
0 |
| 1433 |
Мармелад Таежный сбор 150 г |
ДоброДед |
P |
0 |
| 1429 |
Пастила из Сосновой шишки 45 г (коробочка) |
ДоброДед |
P |
0 |
| 1428 |
Пастила из Морошки 45 г (коробочка) |
ДоброДед |
P |
0 |