Query time 0.00159
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "49.97"
},
"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": 55,
"rows_produced_per_join": 55,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (3288,4931,6036,3035,3220,3410,3443,3599,3730,5107,6112,10237,3043,3737,3880,3638,3655,6178,2429,3729))",
"cost_info": {
"read_cost": "24.26",
"eval_cost": "5.50",
"prefix_cost": "29.76",
"data_read_per_join": "880"
},
"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": 2,
"filtered": "5.00",
"cost_info": {
"read_cost": "13.75",
"eval_cost": "0.28",
"prefix_cost": "49.01",
"data_read_per_join": "8K"
},
"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": 2,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.69",
"eval_cost": "0.28",
"prefix_cost": "49.97",
"data_read_per_join": "44"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 2429 |
450,424,423,166M |
0 |
| 3035 |
423,424,451,166M |
0 |
| 3043 |
423,424,451,166M |
0 |
| 3220 |
450,424,423,166M |
0 |
| 3288 |
426,423,166M |
0 |
| 3410 |
423,424,166M |
0 |
| 3443 |
166,423,448M |
0 |
| 3599 |
423,424,166M |
0 |
| 3638 |
423,166,449M |
0 |
| 3655 |
166,423,448M |
0 |
| 3729 |
166,423,449M |
0 |
| 3730 |
423,449,166M |
0 |
| 3737 |
423,166,448M |
0 |
| 3880 |
423,424,166M |
0 |
| 4931 |
166,423,449M |
0 |
| 5107 |
450,424,423,166M |
0 |
| 6036 |
423,166,585M |
0 |
| 6112 |
424,423,166,450M |
0 |
| 6178 |
423,166,585M |
0 |
| 10237 |
423M |
0 |