Query time 0.00067
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "16.31"
},
"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": 16,
"rows_produced_per_join": 16,
"filtered": "100.00",
"index_condition": "(`test2_gaseus`.`cscart_products_categories`.`product_id` in (13014,13015,13016,13017,13018,13019,13020,13021,13022,13023,13024,13025,13026,13027))",
"cost_info": {
"read_cost": "9.11",
"eval_cost": "1.60",
"prefix_cost": "10.71",
"data_read_per_join": "256"
},
"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": [
"test2_gaseus.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "5.00",
"cost_info": {
"read_cost": "4.00",
"eval_cost": "0.08",
"prefix_cost": "16.31",
"data_read_per_join": "3K"
},
"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')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
| 13014 |
312M |
| 13015 |
312M |
| 13016 |
312M |
| 13017 |
312M |
| 13018 |
312M |
| 13019 |
312M |
| 13020 |
312M |
| 13021 |
312M |
| 13022 |
312M |
| 13023 |
312M |
| 13024 |
312M |
| 13025 |
312M |
| 13026 |
312M |
| 13027 |
312M |