Query time 0.00111
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 (1753,2332,1875,1830,1863,2036,2057,2082,2138,2317,2277,1925,1831,1775,1932,2364,1840,2163,2173,2175,2177,2176,2169,2191,2168,1983,2302,1899,2240,1910,1872,1850,1883,1777,1783,1852,1906,1810,1851,2154,1884,2156,1907,1909,1908,1757,1895,1800,2230,1848,1977,1832,2155,1862,2161,1978,1902,1979,2162,1890,1901,1854,1833,1844,1804,1756,1834,1788,1809,1778,1865,2160,1866,2210,1765,1768,1769,2180,2181,2179))",
"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 |
1753 |
303M |
1756 |
404M |
1757 |
303M |
1765 |
303M |
1768 |
303M |
1769 |
303M |
1775 |
299M |
1777 |
392M |
1778 |
404M |
1783 |
392M |
1788 |
404M |
1800 |
303M |
1804 |
404M |
1809 |
404M |
1810 |
404M |
1830 |
303M |
1831 |
299M |
1832 |
303M |
1833 |
404M |
1834 |
404M |
1840 |
324M |
1844 |
404M |
1848 |
303M |
1850 |
404M |
1851 |
404M |
1852 |
303M |
1854 |
404M |
1862 |
404M |
1863 |
303M |
1865 |
404M |
1866 |
404M |
1872 |
404M |
1875 |
303M |
1883 |
404M |
1884 |
404M |
1890 |
404M |
1895 |
303M |
1899 |
404M |
1901 |
404M |
1902 |
404M |
1906 |
303M |
1907 |
404M |
1908 |
404M |
1909 |
404M |
1910 |
404M |
1925 |
401M |
1932 |
401M |
1977 |
303M |
1978 |
404M |
1979 |
404M |
1983 |
397M |
2036 |
400M |
2057 |
400M |
2082 |
299M |
2138 |
389M |
2154 |
392M |
2155 |
404M |
2156 |
392M |
2160 |
404M |
2161 |
404M |
2162 |
404M |
2163 |
324M |
2168 |
299M |
2169 |
299M |
2173 |
324M |
2175 |
324M |
2176 |
324M |
2177 |
324M |
2179 |
389M |
2180 |
389M |
2181 |
389M |
2191 |
299M |
2210 |
313M |
2230 |
308M |
2240 |
392M |
2277 |
401M |
2302 |
300M |
2317 |
405M |
2332 |
324M |
2364 |
401M |