Query time 0.00131
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "23.91"
},
"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": 23,
"rows_produced_per_join": 23,
"filtered": "100.00",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (1434,1435,1436,1437,1438,1439,3721,3722,5145,5146,5147,5148,7502,7503,7584,7585,7622,7623,7660,7661,7698,7699))",
"cost_info": {
"read_cost": "13.56",
"eval_cost": "2.30",
"prefix_cost": "15.86",
"data_read_per_join": "368"
},
"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": [
"gaseus.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "5.75",
"eval_cost": "0.12",
"prefix_cost": "23.91",
"data_read_per_join": "4K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`gaseus`.`cscart_categories`.`storefront_id` in (0,1)) and ((`gaseus`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`gaseus`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`gaseus`.`cscart_categories`.`usergroup_ids`))) and (`gaseus`.`cscart_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
| 1434 |
308M |
| 1435 |
308M |
| 1436 |
308M |
| 1437 |
308M |
| 1438 |
308M |
| 1439 |
308M |
| 3721 |
308M |
| 3722 |
308M |
| 5145 |
308M |
| 5146 |
308M |
| 5147 |
308M |
| 5148 |
308M |
| 7502 |
308M |
| 7503 |
308M |
| 7584 |
308M |
| 7585 |
308M |
| 7622 |
308M |
| 7623 |
308M |
| 7660 |
308M |
| 7661 |
308M |
| 7698 |
308M |
| 7699 |
308M |