Query time 0.01240
JSON explain
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": ["PRIMARY", "pt"],
"key": "pt",
"key_length": "3",
"used_key_parts": ["product_id"],
"rows": 107,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (47014,46993,40434,47016,5779,49306,858,857,40452,40454,40453,4894,1892,23162,48770,48843,40492,4266,40455,48071,35195,48844,4269,4270,4263,39612,41390,4262,1056,48850,4271,48849)"
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "c_status", "p_category_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"ref": ["dev_db.cscart_products_categories.category_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "cscart_categories.storefront_id in (0,1) and (cscart_categories.usergroup_ids = '' or find_in_set(0,cscart_categories.usergroup_ids) or find_in_set(1,cscart_categories.usergroup_ids)) and cscart_categories.`status` in ('A','H')"
}
},
{
"table": {
"table_name": "product_position_source",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "pt"],
"key": "PRIMARY",
"key_length": "6",
"used_key_parts": ["category_id", "product_id"],
"ref": ["const", "dev_db.cscart_products_categories.product_id"],
"rows": 1,
"filtered": 100
}
}
]
}
}
Result
product_id |
category_ids |
position |
857 |
209,210,142M |
0 |
858 |
209,210,315,142M |
0 |
1056 |
210,209,409,160M |
0 |
1892 |
212,315,210,209,409,196M |
0 |
4262 |
209,316M |
0 |
4263 |
209,316M |
0 |
4266 |
209,316M |
0 |
4269 |
209,316M |
0 |
4270 |
209,316M |
0 |
4271 |
209,316M |
0 |
4894 |
183,209,412,210M |
0 |
5779 |
209,210,213,412,114M |
0 |
23162 |
209,160M |
0 |
35195 |
209,154M |
0 |
39612 |
212,210,209,409,149M |
0 |
40434 |
210,209,409,149M |
0 |
40452 |
209,409,153M |
0 |
40453 |
315,209,409,153M |
0 |
40454 |
315,209,409,153M |
0 |
40455 |
315,209,409,153M |
0 |
40492 |
209,210,212,202M |
0 |
41390 |
210,107,209M |
0 |
46993 |
209,210,213,169M |
0 |
47014 |
210,209,141M |
0 |
47016 |
209,210,141M |
0 |
48071 |
210,209,213,114M |
0 |
48770 |
209,210,176M |
0 |
48843 |
209,409,153M |
0 |
48844 |
209,153M |
0 |
48849 |
209,409,153M |
0 |
48850 |
209,153M |
0 |
49306 |
409,209,210,154M |
0 |