Query time 0.00101
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "31.35"
},
"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": 31,
"rows_produced_per_join": 31,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (7255,8066,8545,7491,7915,7494,7557,7566,8257,8547,7502,7560,7561,7725,7896,8218,7501,7508,7558,7559,7565,7567,7848,7853))",
"cost_info": {
"read_cost": "16.86",
"eval_cost": "3.10",
"prefix_cost": "19.96",
"data_read_per_join": "496"
},
"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": "7.75",
"eval_cost": "0.16",
"prefix_cost": "30.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.39",
"eval_cost": "0.16",
"prefix_cost": "31.35",
"data_read_per_join": "24"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 7255 |
623M |
0 |
| 7491 |
623M |
0 |
| 7494 |
623M |
0 |
| 7501 |
623M |
0 |
| 7502 |
623M |
0 |
| 7508 |
623M |
0 |
| 7557 |
623M |
0 |
| 7558 |
623M |
0 |
| 7559 |
623M |
0 |
| 7560 |
623M |
0 |
| 7561 |
623M |
0 |
| 7565 |
623M |
0 |
| 7566 |
623M |
0 |
| 7567 |
623M |
0 |
| 7725 |
623M |
0 |
| 7848 |
623M |
0 |
| 7853 |
623,622,625M |
0 |
| 7896 |
623,622,625M |
0 |
| 7915 |
623,622,625M |
0 |
| 8066 |
623,622,625M |
0 |
| 8218 |
623,622,625M |
0 |
| 8257 |
623M |
0 |
| 8545 |
623M |
0 |
| 8547 |
623M |
0 |