Query time 0.00341
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "20.23"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_product_sales",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pa"
],
"key": "pa",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 12,
"rows_produced_per_join": 12,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "3.43",
"eval_cost": "2.40",
"prefix_cost": "5.83",
"data_read_per_join": "192"
},
"used_columns": [
"category_id",
"product_id",
"amount"
],
"attached_condition": "(`twebezli_Commercemodalpopup`.`cscart_product_sales`.`product_id` in (148,5,23,1,149,79,238,239,172,167,12,8))"
}
},
{
"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": [
"twebezli_Commercemodalpopup.cscart_product_sales.category_id",
"twebezli_Commercemodalpopup.cscart_product_sales.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 7,
"filtered": "63.47",
"cost_info": {
"read_cost": "12.00",
"eval_cost": "1.52",
"prefix_cost": "20.23",
"data_read_per_join": "121"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`twebezli_Commercemodalpopup`.`cscart_products_categories`.`link_type` = 'M')"
}
}
]
}
}
Result
product_id |
sales_amount |
23 |
1 |
148 |
349 |