Query time 0.00105
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "24.46"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "0.98"
},
"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": 0,
"filtered": "2.25",
"index_condition": "(`cscartdevel`.`cscart_products_categories`.`product_id` in (2227,2060,2122,2274,2061,1957,1814,2331,1748,2005,2214,2342,2215,2211,2225,2212,2213,2226,2303,2260,2195,2130,2332,1840,2163,2173,2175,2177,2176,2070,2069,2351,2209,2261,2174,2235))",
"cost_info": {
"read_cost": "10.88",
"eval_cost": "0.10",
"prefix_cost": "23.14",
"data_read_per_join": "15"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"table": {
"table_name": "product_position_source",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"ref": [
"const",
"cscartdevel.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.25",
"eval_cost": "0.10",
"prefix_cost": "23.48",
"data_read_per_join": "15"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
product_id |
category_ids |
position |
1748 |
324M |
0 |
1814 |
324M |
0 |
1840 |
324M |
0 |
1957 |
324M |
0 |
2005 |
324M |
0 |
2060 |
324M |
0 |
2061 |
324M |
0 |
2069 |
324M |
0 |
2070 |
324M |
0 |
2122 |
324M |
0 |
2130 |
324M |
0 |
2163 |
324M |
0 |
2173 |
324M |
0 |
2174 |
324M |
0 |
2175 |
324M |
0 |
2176 |
324M |
0 |
2177 |
324M |
0 |
2195 |
324M |
0 |
2209 |
324M |
0 |
2211 |
324M |
0 |
2212 |
324M |
0 |
2213 |
324M |
0 |
2214 |
324M |
0 |
2215 |
324M |
0 |
2225 |
324M |
0 |
2226 |
324M |
0 |
2227 |
324M |
0 |
2235 |
324M |
0 |
2260 |
324M |
0 |
2261 |
324M |
0 |
2274 |
324M |
0 |
2303 |
324M |
0 |
2331 |
324M |
0 |
2332 |
324M |
0 |
2342 |
324M |
0 |
2351 |
324M |
0 |