Query time 0.00646
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "7.26"
},
"ordering_operation": {
"using_temporary_table": true,
"using_filesort": true,
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "companies",
"access_type": "system",
"possible_keys": [
"PRIMARY",
"status"
],
"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": "5K"
},
"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": "3K"
},
"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",
"storefront_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",
"storefront_id",
"usergroup_ids",
"status"
]
}
},
{
"table": {
"table_name": "cscart_product_sales",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pa"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"const"
],
"rows_examined_per_scan": 21,
"rows_produced_per_join": 6,
"filtered": "33.33",
"cost_info": {
"read_cost": "3.19",
"eval_cost": "0.70",
"prefix_cost": "5.29",
"data_read_per_join": "111"
},
"used_columns": [
"category_id",
"product_id",
"amount"
],
"attached_condition": "(`unicomps`.`cscart_product_sales`.`amount` >= 1)"
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"ref": [
"const",
"unicomps.cscart_product_sales.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 6,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.70",
"prefix_cost": "5.99",
"data_read_per_join": "111"
},
"used_columns": [
"product_id",
"category_id"
]
}
},
{
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"status",
"usergroup_ids",
"company_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"unicomps.cscart_product_sales.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "17.95",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.13",
"prefix_cost": "6.69",
"data_read_per_join": "8K"
},
"used_columns": [
"product_id",
"product_type",
"status",
"company_id",
"usergroup_ids",
"parent_product_id"
],
"attached_condition": "((`unicomps`.`products`.`company_id` = '1') and ((`unicomps`.`products`.`usergroup_ids` = '') or (0 <> find_in_set(0,`unicomps`.`products`.`usergroup_ids`)) or (0 <> find_in_set(1,`unicomps`.`products`.`usergroup_ids`))) and (`unicomps`.`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": [
"unicomps.cscart_product_sales.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.13",
"prefix_cost": "6.82",
"data_read_per_join": "5K"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
},
{
"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": [
"unicomps.cscart_product_sales.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "25.00",
"using_index": true,
"cost_info": {
"read_cost": "0.31",
"eval_cost": "0.03",
"prefix_cost": "7.26",
"data_read_per_join": "10"
},
"used_columns": [
"product_id",
"lower_limit",
"usergroup_id"
],
"attached_condition": "((`unicomps`.`prices`.`lower_limit` = 1) and (`unicomps`.`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 |
sales_amount |
| 7140 |
Тонер-картридж HI-BLACK TK-1140 для Kyocera-Mita FS-1035MFP/DP/1135MFP (401070575) |
unicomps |
7140 |
P |
0 |
P |
0 |
2 |
| 2285 |
Тонер-картридж HP 30A, Black M203/MFP M227 (1600 стр) (CF230A) |
unicomps |
2285 |
P |
0 |
P |
0 |
1 |
| 19035 |
Тонер-картридж RICOH Aficio MP C2003SP/C2503SP/C2003ZSP/C2503ZSP черный, type MPC2503 (15K) (841925) |
unicomps |
19035 |
P |
0 |
P |
0 |
1 |
| 57924 |
Тонер-картридж KONICA MINOLTA bizhub PRESS 1052/1250 TN-014 (o) (A3VV150) |
unicomps |
57924 |
P |
0 |
P |
0 |
1 |
| 114151 |
Тонер-картридж RICOH большой емкости тип IMC2500H голубой для IMC2000/2500 (10500стр) (842314) |
unicomps |
114151 |
P |
0 |
P |
0 |
1 |