Query time 0.00103
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "63.46"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"link_type",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 39,
"rows_produced_per_join": 39,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "8.87",
"eval_cost": "7.80",
"prefix_cost": "16.67",
"data_read_per_join": "624"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`webmarco`.`cscart_products_categories`.`product_id` in (392224,392211,392226,392228,392223,392225,392227,392210,392230,392231,392229,392232,392236,392237,392235,392234,392238,392239,392241,392233,392240,392255,392253,392254,392252,392242,392243,392249,392244,392250,392245,392246,392251,392247,392248,392222,392221,392220,392219))"
}
},
{
"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": [
"webmarco.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "39.00",
"eval_cost": "0.39",
"prefix_cost": "63.47",
"data_read_per_join": "11K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`webmarco`.`cscart_categories`.`storefront_id` in (0,1)) and ((`webmarco`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`webmarco`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`webmarco`.`cscart_categories`.`usergroup_ids`)) and (`webmarco`.`cscart_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
product_id |
category_ids |
392210 |
9971M |
392211 |
2695M |
392219 |
2695M |
392220 |
2695M |
392221 |
2695M |
392222 |
9971M |
392223 |
2695M |
392224 |
2695M |
392225 |
2695M |
392226 |
2695M |
392227 |
2695M |
392228 |
2695M |
392229 |
9971M |
392230 |
9971M |
392231 |
9971M |
392232 |
9971M |
392233 |
2695M |
392234 |
2695M |
392235 |
2695M |
392236 |
2695M |
392237 |
2695M |
392238 |
2695M |
392239 |
2695M |
392240 |
2695M |
392241 |
2695M |
392242 |
10229M |
392243 |
10229M |
392244 |
10229M |
392245 |
10229M |
392246 |
10229M |
392247 |
10229M |
392248 |
10229M |
392249 |
10229M |
392250 |
10229M |
392251 |
10229M |
392252 |
9994M |
392253 |
9994M |
392254 |
9994M |
392255 |
9994M |