Query time 0.02066
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": 88,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (50216,47597,18608,27359,3713,37096,27354,27357,27358,27360,27362,36399,19386,27363,3662,36339,3666,637,2553,534,25180,3004,47603,37097,47610,43459,43460,41369,43461,40928,43842,43841)"
}
},
{
"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 |
534 |
166,212M |
|
637 |
213,191,409,193M |
|
2553 |
166,212M |
|
3004 |
166M |
|
3662 |
169,412,210M |
|
3666 |
169,412,210M |
|
3713 |
412,210M |
|
18608 |
110,163,166,318M |
|
19386 |
213,169,412,210M |
|
25180 |
166,212M |
|
27354 |
409,165M |
|
27357 |
213,409,165M |
|
27358 |
210,212,409,165M |
|
27359 |
409,165M |
|
27360 |
409,165M |
|
27362 |
409,165M |
|
27363 |
409,165M |
|
36339 |
163,318M |
|
36399 |
163M |
|
37096 |
412,166,210,169,213M |
|
37097 |
213,210,166,169M |
|
40928 |
412,213,210,169M |
|
41369 |
145M |
|
43459 |
182M |
|
43460 |
182M |
|
43461 |
182M |
|
43841 |
182M |
|
43842 |
182M |
|
47597 |
210,212,409,166M |
|
47603 |
210,212,166M |
|
47610 |
210,212,409,166M |
|
50216 |
409,166,165M |
|