Query time 0.00078
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "39.92"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "4.80"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 40,
"rows_produced_per_join": 1,
"filtered": "4.00",
"cost_info": {
"read_cost": "4.54",
"eval_cost": "0.16",
"prefix_cost": "4.70",
"data_read_per_join": "6K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`gaseus`.`cscart_categories`.`storefront_id` in (0,1)) and ((`gaseus`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`gaseus`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`gaseus`.`cscart_categories`.`usergroup_ids`))) and (`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": 30,
"rows_produced_per_join": 4,
"filtered": "10.00",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (11887,11888,11889,11890,11891,11892,11893,11894,11895,11896,11897,11898,11899,11900,11901,11902,11903,11904,11905,11906,11907,11908))",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "25.62",
"eval_cost": "0.48",
"prefix_cost": "35.12",
"data_read_per_join": "76"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`gaseus`.`cscart_products_categories`.`category_id` = `gaseus`.`cscart_categories`.`category_id`)"
}
}
]
}
}
}
Result
| product_id |
category_ids |
| 11887 |
306M |
| 11888 |
306M |
| 11889 |
306M |
| 11890 |
306M |
| 11891 |
306M |
| 11892 |
306M |
| 11893 |
306M |
| 11894 |
306M |
| 11895 |
306M |
| 11896 |
306M |
| 11897 |
306M |
| 11898 |
306M |
| 11899 |
306M |
| 11900 |
306M |
| 11901 |
306M |
| 11902 |
306M |
| 11903 |
306M |
| 11904 |
306M |
| 11905 |
306M |
| 11906 |
306M |
| 11907 |
306M |
| 11908 |
306M |