Query time 0.00103
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "26.32"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "2.23"
},
"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": 17,
"rows_produced_per_join": 2,
"filtered": "4.82",
"index_condition": "(`cscartdevel`.`cscart_products_categories`.`product_id` in (2187,2260,1861,1747,1780,1797,1823,1782,1798,1772,1755,2028,2118,2116,2117,1966,1967,1965,2026,2027,2131,1938,2025,2062,2369,1856,2205,1846,1885,1873,1824,1869,2004,2140,2139,2141,2150,1935,2003,2007,2076,1867,2029,2361,1825,1826,2390,2391,2270,2272,2273,2308,2378,2220,2022,2015,1980,1976,1927,2058,1975,1964,2136,1749,1973,2339,1974,2354,1972,2352,2030,2269,2289,2167,2128,1968,1969,2192,2297,2037))",
"cost_info": {
"read_cost": "11.56",
"eval_cost": "0.22",
"prefix_cost": "24.09",
"data_read_per_join": "35"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
}
]
}
}
}
Result
product_id |
category_ids |
1747 |
386M |
1749 |
303M |
1755 |
386M |
1772 |
386M |
1780 |
386M |
1782 |
386M |
1797 |
386M |
1798 |
386M |
1823 |
386M |
1824 |
303M |
1825 |
303M |
1826 |
303M |
1846 |
303M |
1856 |
303M |
1861 |
303M |
1867 |
298M |
1869 |
303M |
1873 |
303M |
1885 |
303M |
1927 |
389M |
1935 |
300M |
1938 |
404M |
1964 |
389M |
1965 |
404M |
1966 |
404M |
1967 |
404M |
1968 |
306M |
1969 |
306M |
1972 |
321M |
1973 |
321M |
1974 |
321M |
1975 |
389M |
1976 |
389M |
1980 |
389M |
2003 |
300M |
2004 |
300M |
2007 |
306M |
2015 |
299M |
2022 |
299M |
2025 |
404M |
2026 |
404M |
2027 |
404M |
2028 |
404M |
2029 |
298M |
2030 |
306M |
2037 |
305M |
2058 |
389M |
2062 |
362M |
2076 |
306M |
2116 |
404M |
2117 |
404M |
2118 |
404M |
2128 |
306M |
2131 |
404M |
2136 |
389M |
2139 |
300M |
2140 |
300M |
2141 |
300M |
2150 |
300M |
2167 |
306M |
2187 |
321M |
2192 |
306M |
2205 |
313M |
2220 |
299M |
2260 |
324M |
2269 |
306M |
2270 |
363M |
2272 |
363M |
2273 |
363M |
2289 |
306M |
2297 |
305M |
2308 |
363M |
2339 |
321M |
2352 |
306M |
2354 |
321M |
2361 |
303M |
2369 |
362M |
2378 |
299M |
2390 |
313M |
2391 |
313M |