Query time 0.00091
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "41.01"
},
"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": 45,
"rows_produced_per_join": 45,
"filtered": "100.00",
"index_condition": "(`test_uchur_k`.`cscart_products_categories`.`product_id` in (65,50992,51374,51375,50993,51381,51382,51384,140,51385,51386,51387,51388,51389,89,51390,51391,51392,51393,51394))",
"cost_info": {
"read_cost": "20.76",
"eval_cost": "4.50",
"prefix_cost": "25.26",
"data_read_per_join": "720"
},
"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": [
"test_uchur_k.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 2,
"filtered": "5.00",
"cost_info": {
"read_cost": "11.25",
"eval_cost": "0.23",
"prefix_cost": "41.01",
"data_read_per_join": "11K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`test_uchur_k`.`cscart_categories`.`storefront_id` in (0,1)) and ((`test_uchur_k`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`test_uchur_k`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`test_uchur_k`.`cscart_categories`.`usergroup_ids`))) and (`test_uchur_k`.`cscart_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
| 65 |
45,25M |
| 89 |
25,42,40M |
| 140 |
25,42,40M |
| 50992 |
25M |
| 50993 |
25M |
| 51374 |
25M |
| 51375 |
25M |
| 51381 |
25M |
| 51382 |
25M |
| 51384 |
25M |
| 51385 |
42,25,40M |
| 51386 |
42,25,40M |
| 51387 |
42,25,40M |
| 51388 |
42,25,40M |
| 51389 |
42,25,40M |
| 51390 |
42,25,40M |
| 51391 |
42,25,40M |
| 51392 |
42,25,40M |
| 51393 |
42,25,40M |
| 51394 |
25,42,40M |