Query time 0.00105
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "54.57"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "6.44"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 46,
"rows_produced_per_join": 1,
"filtered": "4.00",
"cost_info": {
"read_cost": "5.15",
"eval_cost": "0.18",
"prefix_cost": "5.33",
"data_read_per_join": "7K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`test2_gaseus`.`cscart_categories`.`storefront_id` in (0,1)) and ((`test2_gaseus`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`test2_gaseus`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`test2_gaseus`.`cscart_categories`.`usergroup_ids`))) and (`test2_gaseus`.`cscart_categories`.`status` in ('A','H')))"
}
},
{
"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": 35,
"rows_produced_per_join": 6,
"filtered": "10.00",
"index_condition": "(`test2_gaseus`.`cscart_products_categories`.`product_id` in (12752,12753,12754,12755,12756,12757,12758,12759,12760,12761,12762,12763,12764,12765,12766,12767,12768,12769,12770,12771,12772,12773,12774,12775,12776,12777,12778,12779,12780,12781))",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "36.36",
"eval_cost": "0.64",
"prefix_cost": "48.13",
"data_read_per_join": "103"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`test2_gaseus`.`cscart_products_categories`.`category_id` = `test2_gaseus`.`cscart_categories`.`category_id`)"
}
}
]
}
}
}
Result
| product_id |
category_ids |
| 12752 |
283M |
| 12753 |
283M |
| 12754 |
283M |
| 12755 |
283M |
| 12756 |
283M |
| 12757 |
283M |
| 12758 |
283M |
| 12759 |
283M |
| 12760 |
283M |
| 12761 |
283M |
| 12762 |
283M |
| 12763 |
283M |
| 12764 |
283M |
| 12765 |
283M |
| 12766 |
283M |
| 12767 |
283M |
| 12768 |
283M |
| 12769 |
283M |
| 12770 |
283M |
| 12771 |
283M |
| 12772 |
283M |
| 12773 |
283M |
| 12774 |
283M |
| 12775 |
283M |
| 12776 |
283M |
| 12777 |
283M |
| 12778 |
283M |
| 12779 |
283M |
| 12780 |
283M |
| 12781 |
283M |