Query time 0.00051
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "22.24"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_multi_decproduct_sales",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"pa"
],
"rows_examined_per_scan": 17,
"rows_produced_per_join": 14,
"filtered": "82.35",
"cost_info": {
"read_cost": "2.64",
"eval_cost": "2.80",
"prefix_cost": "5.44",
"data_read_per_join": "224"
},
"used_columns": [
"category_id",
"product_id",
"amount"
],
"attached_condition": "(`vishalecarter_multi_dec`.`cscart_multi_decproduct_sales`.`product_id` in (12,148,5,23,1,149,79,238,239,172,167,8,150,13))"
}
},
{
"table": {
"table_name": "cscart_multi_decproducts_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"link_type",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"ref": [
"vishalecarter_multi_dec.cscart_multi_decproduct_sales.category_id",
"vishalecarter_multi_dec.cscart_multi_decproduct_sales.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 12,
"filtered": "91.04",
"cost_info": {
"read_cost": "14.00",
"eval_cost": "2.55",
"prefix_cost": "22.24",
"data_read_per_join": "203"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`vishalecarter_multi_dec`.`cscart_multi_decproducts_categories`.`link_type` = 'M')"
}
}
]
}
}
Result
| product_id |
sales_amount |
| 12 |
4 |
| 23 |
2 |
| 1 |
2 |
| 149 |
1 |