Query time 0.00120
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "53.56"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "6.26"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 46,
"rows_produced_per_join": 1,
"filtered": "4.00",
"cost_info": {
"read_cost": "5.15",
"eval_cost": "0.18",
"prefix_cost": "5.33",
"data_read_per_join": "7K"
},
"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')))"
}
},
{
"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": 34,
"rows_produced_per_join": 6,
"filtered": "10.00",
"index_condition": "(`test2_gaseus`.`cscart_products_categories`.`product_id` in (12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493))",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "35.71",
"eval_cost": "0.63",
"prefix_cost": "47.30",
"data_read_per_join": "100"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`test2_gaseus`.`cscart_products_categories`.`category_id` = `test2_gaseus`.`cscart_categories`.`category_id`)"
}
}
]
}
}
}
Result
| product_id |
category_ids |
| 12464 |
284M |
| 12465 |
284M |
| 12466 |
284M |
| 12467 |
284M |
| 12468 |
284M |
| 12469 |
284M |
| 12470 |
284M |
| 12471 |
284M |
| 12472 |
284M |
| 12473 |
284M |
| 12474 |
284M |
| 12475 |
284M |
| 12476 |
284M |
| 12477 |
284M |
| 12478 |
284M |
| 12479 |
284M |
| 12480 |
284M |
| 12481 |
284M |
| 12482 |
284M |
| 12483 |
284M |
| 12484 |
284M |
| 12485 |
284M |
| 12486 |
284M |
| 12487 |
284M |
| 12488 |
284M |
| 12489 |
284M |
| 12490 |
284M |
| 12491 |
284M |
| 12492 |
284M |
| 12493 |
284M |