Query time 0.00073
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "35.60"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "4.16"
},
"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": 26,
"rows_produced_per_join": 4,
"filtered": "10.00",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (11909,11910,11911,11912,11913,11914,11915,11916,11917,11918,11919,11920,11921,11922,11923,11924,11925,11926,11927,11928))",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "22.58",
"eval_cost": "0.42",
"prefix_cost": "31.44",
"data_read_per_join": "66"
},
"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 |
| 11909 |
306M |
| 11910 |
306M |
| 11911 |
306M |
| 11912 |
306M |
| 11913 |
306M |
| 11914 |
306M |
| 11915 |
306M |
| 11916 |
306M |
| 11917 |
306M |
| 11918 |
306M |
| 11919 |
306M |
| 11920 |
306M |
| 11921 |
306M |
| 11922 |
306M |
| 11923 |
306M |
| 11924 |
306M |
| 11925 |
306M |
| 11926 |
306M |
| 11927 |
306M |
| 11928 |
306M |