Query time 0.01607
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": 131,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (49186,46696,48822,47274,47610,43651,49256,45568,43650,46273,48683,48677,43649,48851,45281,47486,46709,47492,48685,48716,49397,49398,49221,49663,49030,49400,49399,49540,49503,49501,49502,49550)"
}
},
{
"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 |
43649 |
210,409,154M |
0 |
43650 |
409,160M |
0 |
43651 |
409,160M |
0 |
45281 |
409,154M |
0 |
45568 |
409,169M |
0 |
46273 |
409,100M |
0 |
46696 |
210,213,409,166M |
0 |
46709 |
409,166M |
0 |
47274 |
210,209,409,99M |
0 |
47486 |
409,159M |
0 |
47492 |
409,159M |
0 |
47610 |
210,212,409,166M |
0 |
48677 |
409,315,213,210,169M |
0 |
48683 |
210,213,409,315,169M |
0 |
48685 |
409,412,213,210,315,169M |
0 |
48716 |
409,315,210,213,169M |
0 |
48822 |
212,195,409,166M |
0 |
48851 |
409,209,153M |
0 |
49030 |
409,159M |
0 |
49186 |
409,160M |
0 |
49221 |
211,210,209,409,412,119M |
0 |
49256 |
409,210,160M |
0 |
49397 |
209,409,153M |
0 |
49398 |
209,409,153M |
0 |
49399 |
209,409,153M |
0 |
49400 |
209,409,153M |
0 |
49501 |
409,153,209M |
0 |
49502 |
209,409,153M |
0 |
49503 |
209,409,153M |
0 |
49540 |
209,409,153M |
0 |
49550 |
209,409,153M |
0 |
49663 |
409,209,153M |
0 |