Query time 0.00102
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "25.34"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "2.20"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 68,
"rows_produced_per_join": 2,
"filtered": "4.00",
"cost_info": {
"read_cost": "7.63",
"eval_cost": "0.27",
"prefix_cost": "7.91",
"data_read_per_join": "9K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`cscartdevel`.`cscart_categories`.`storefront_id` in (0,1)) and ((`cscartdevel`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`cscartdevel`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`cscartdevel`.`cscart_categories`.`usergroup_ids`))) and (`cscartdevel`.`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": [
"cscartdevel.cscart_categories.category_id"
],
"rows_examined_per_scan": 16,
"rows_produced_per_join": 2,
"filtered": "5.05",
"index_condition": "(`cscartdevel`.`cscart_products_categories`.`product_id` in (1987,2110,2111,2112,1900,1813,1820,2366,1897,1750,1924,2227,2204,2010,2309,2060,2122,2274,2061,1918,1913,1958,2290,1751,1957,2202,1814,2331,1748,2005,2214,2342,2215,2211,2225,2212,2213,2226,2151,1882,1815,1853,1759,2001,2276,2231,2281,2379,2388,2115,1929,2373,2372,2374,1760,1807,1847,2363,1816,2146,2201,2386,2359,2279,1843,1859,1794,1793,1817,1795,2278,1818,1784,1819,1849,2338,2383,2337,2336,2389))",
"cost_info": {
"read_cost": "10.88",
"eval_cost": "0.22",
"prefix_cost": "23.14",
"data_read_per_join": "35"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
}
]
}
}
}
Result
product_id |
category_ids |
1748 |
324M |
1750 |
299M |
1751 |
313M |
1759 |
388M |
1760 |
303M |
1784 |
388M |
1793 |
388M |
1794 |
388M |
1795 |
388M |
1807 |
303M |
1813 |
404M |
1814 |
324M |
1815 |
388M |
1816 |
303M |
1817 |
388M |
1818 |
388M |
1819 |
303M |
1820 |
303M |
1843 |
388M |
1847 |
303M |
1849 |
303M |
1853 |
388M |
1859 |
388M |
1882 |
388M |
1897 |
303M |
1900 |
404M |
1913 |
299M |
1918 |
299M |
1924 |
403M |
1929 |
299M |
1957 |
324M |
1958 |
396M |
1987 |
394M |
2001 |
388M |
2005 |
324M |
2010 |
313M |
2060 |
324M |
2061 |
324M |
2110 |
394M |
2111 |
394M |
2112 |
394M |
2115 |
299M |
2122 |
324M |
2146 |
313M |
2151 |
313M |
2201 |
313M |
2202 |
299M |
2204 |
313M |
2211 |
324M |
2212 |
324M |
2213 |
324M |
2214 |
324M |
2215 |
324M |
2225 |
324M |
2226 |
324M |
2227 |
324M |
2231 |
313M |
2274 |
324M |
2276 |
401M |
2278 |
401M |
2279 |
401M |
2281 |
389M |
2290 |
313M |
2309 |
405M |
2331 |
324M |
2336 |
392M |
2337 |
392M |
2338 |
392M |
2342 |
324M |
2359 |
390M |
2363 |
303M |
2366 |
362M |
2372 |
362M |
2373 |
362M |
2374 |
362M |
2379 |
389M |
2383 |
392M |
2386 |
390M |
2388 |
299M |
2389 |
313M |