Query time 0.00170
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "26.34"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "1.43"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 59,
"rows_produced_per_join": 2,
"filtered": "4.00",
"cost_info": {
"read_cost": "6.76",
"eval_cost": "0.24",
"prefix_cost": "7.00",
"data_read_per_join": "10K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`testdobroded`.`cscart_categories`.`storefront_id` in (0,1)) and ((`testdobroded`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`testdobroded`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`testdobroded`.`cscart_categories`.`usergroup_ids`))) and (`testdobroded`.`cscart_categories`.`status` in ('A','H')))"
}
},
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"testdobroded.cscart_categories.category_id"
],
"rows_examined_per_scan": 25,
"rows_produced_per_join": 1,
"filtered": "2.43",
"index_condition": "(`testdobroded`.`cscart_products_categories`.`product_id` in (36,45,55,56,58,65,69,1535,1536,1537,1538,1539,1540,1542))",
"cost_info": {
"read_cost": "12.01",
"eval_cost": "0.14",
"prefix_cost": "24.91",
"data_read_per_join": "22"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
| 36 |
48,1M |
| 45 |
48,1M |
| 55 |
48,1M |
| 56 |
48,1M |
| 58 |
48,1M |
| 65 |
48,1M |
| 69 |
48,1M |
| 1535 |
48,1M |
| 1536 |
48,1M |
| 1537 |
48,1M |
| 1538 |
48,1M |
| 1539 |
48,1M |
| 1540 |
48,1M |
| 1542 |
48,1M |