Query time 0.00695
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": 164,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (48848,49397,49398,49663,49400,49540,49399,49503,49501,49550,49502,49543,49383,49541,49542,49504,49547,49664,49549,49661,49665,49666,49551,49604,49548,50147,49662,50218,49572,50219,50220)"
}
},
{
"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 |
48848 |
209,153M |
0 |
49383 |
409,209,315,153M |
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 |
49504 |
209,409,153M |
0 |
49540 |
209,409,153M |
0 |
49541 |
409,209,153M |
0 |
49542 |
409,209,153M |
0 |
49543 |
409,209,153M |
0 |
49547 |
409,209,153M |
0 |
49548 |
409,209,153M |
0 |
49549 |
409,209,153M |
0 |
49550 |
209,409,153M |
0 |
49551 |
409,209,153M |
0 |
49572 |
409,110,209,153M |
0 |
49604 |
209,409,153M |
0 |
49661 |
209,409,153M |
0 |
49662 |
209,409,153M |
0 |
49663 |
409,209,153M |
0 |
49664 |
409,209,153M |
0 |
49665 |
209,409,153M |
0 |
49666 |
409,209,153M |
0 |
50147 |
153,209,409,110M |
0 |
50218 |
209,210,409,153M |
0 |
50219 |
209,210,409,153M |
0 |
50220 |
209,210,409,153M |
0 |