Query time 0.00082
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "123.01"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "q_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": 35,
"filtered": "100.00",
"index_condition": "(`portal`.`q_products_categories`.`product_id` in (9741,9742,9743,9744,9745,9746,9747,9748,9749,9750,9751,9752,9753,9754,9755,9756,9757,9758,9759,9760,9761,9762,9763,9764,9765,9766,9767,9768,9769,9770,9771,9772))",
"cost_info": {
"read_cost": "74.01",
"eval_cost": "7.00",
"prefix_cost": "81.01",
"data_read_per_join": "560"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"table": {
"table_name": "q_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"portal.q_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 7,
"filtered": "20.00",
"cost_info": {
"read_cost": "35.00",
"eval_cost": "1.40",
"prefix_cost": "123.01",
"data_read_per_join": "18K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status"
],
"attached_condition": "(((`portal`.`q_categories`.`usergroup_ids` = '') or find_in_set(0,`portal`.`q_categories`.`usergroup_ids`) or find_in_set(1,`portal`.`q_categories`.`usergroup_ids`)) and (`portal`.`q_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
product_id |
category_ids |
9741 |
193M |
9742 |
193M |
9743 |
194M |
9744 |
402M |
9745 |
202M |
9746 |
202M |
9747 |
402M |
9748 |
202M |
9749 |
402M |
9750 |
202M |
9751 |
402M |
9752 |
202M |
9753 |
202M |
9754 |
202M |
9755 |
402,202M |
9756 |
402M |
9757 |
402M |
9758 |
402M |
9759 |
402M |
9760 |
193,402M |
9761 |
202M |
9762 |
202M |
9763 |
402M |
9764 |
193M |
9765 |
193M |
9766 |
202M |
9767 |
202M |
9768 |
167M |
9769 |
167M |
9770 |
167M |
9771 |
167M |
9772 |
167M |