Query time 0.00048
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "35.66"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_product_sales",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"pa"
],
"rows_examined_per_scan": 24,
"rows_produced_per_join": 24,
"filtered": "100.00",
"cost_info": {
"read_cost": "2.06",
"eval_cost": "4.80",
"prefix_cost": "6.86",
"data_read_per_join": "384"
},
"used_columns": [
"category_id",
"product_id",
"amount"
],
"attached_condition": "(`atulecarter_atul_demo1`.`cscart_product_sales`.`product_id` in (12,325,148,5,23,1,149,79,238,239,172,167,292,300,303,304,305,306,307,308,309,310,311,312,313,314,315,316,291,293,298,334,335,302,317,319,320,321,322,323,337,8,150,13))"
}
},
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"link_type",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"ref": [
"atulecarter_atul_demo1.cscart_product_sales.category_id",
"atulecarter_atul_demo1.cscart_product_sales.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 22,
"filtered": "93.35",
"cost_info": {
"read_cost": "24.00",
"eval_cost": "4.48",
"prefix_cost": "35.66",
"data_read_per_join": "358"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`atulecarter_atul_demo1`.`cscart_products_categories`.`link_type` = 'M')"
}
}
]
}
}
Result
product_id |
sales_amount |
317 |
8 |
304 |
5 |
303 |
14 |
298 |
1 |
292 |
3 |
300 |
37 |
308 |
1 |
309 |
1 |
310 |
1 |
334 |
1 |