Query time 0.00241
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "27.26"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 26,
"rows_produced_per_join": 26,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (9796,9806,9815,9824,9851,9853,9856,9861,9887,9890,9897,9898,9903,9938,9957,9991,9993,10061,9198,8036,8047,9026,9073,9074))",
"cost_info": {
"read_cost": "15.11",
"eval_cost": "2.60",
"prefix_cost": "17.71",
"data_read_per_join": "416"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"softwarepirmam_hewadelivard_cscart_4.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "6.50",
"eval_cost": "0.13",
"prefix_cost": "26.81",
"data_read_per_join": "4K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`storefront_id` in (0,1)) and ((`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`))) and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`status` in ('A','H')))"
}
},
{
"table": {
"table_name": "product_position_source",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"ref": [
"const",
"softwarepirmam_hewadelivard_cscart_4.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.33",
"eval_cost": "0.13",
"prefix_cost": "27.27",
"data_read_per_join": "20"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 8036 |
623,622,625M |
0 |
| 8047 |
623,622,627M |
0 |
| 9026 |
622M |
0 |
| 9073 |
622M |
0 |
| 9074 |
622M |
0 |
| 9198 |
622M |
0 |
| 9796 |
622M |
0 |
| 9806 |
622M |
0 |
| 9815 |
622M |
0 |
| 9824 |
622M |
0 |
| 9851 |
622M |
0 |
| 9853 |
622M |
0 |
| 9856 |
622M |
0 |
| 9861 |
622M |
0 |
| 9887 |
622M |
0 |
| 9890 |
622M |
0 |
| 9897 |
622M |
0 |
| 9898 |
622M |
0 |
| 9903 |
622M |
0 |
| 9938 |
622M |
0 |
| 9957 |
622M |
0 |
| 9991 |
622M |
0 |
| 9993 |
622M |
0 |
| 10061 |
622M |
0 |