Query time 0.00479
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": 63,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (31638,3870,114,47923,1582,2143,33312,31633,31632,3287,3286,3872,113,5300,3517,5991,2144,3516,33744,5297,1980,1103,65,5543,31634,5784,41281,6652,3518,41282,40445,40442)"
}
},
{
"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 |
65 |
412,119,118M |
|
113 |
111M |
|
114 |
111M |
|
1103 |
122M |
|
1582 |
111M |
|
1980 |
122M |
|
2143 |
116M |
|
2144 |
116M |
|
3286 |
315,412,118,119M |
|
3287 |
315,412,118,119M |
|
3516 |
340,313M |
|
3517 |
340,313M |
|
3518 |
340,313M |
|
3870 |
313,166M |
|
3872 |
313,166M |
|
5297 |
122,412 |
|
5300 |
122,412 |
|
5543 |
118M |
|
5784 |
114M |
|
5991 |
121M |
|
6652 |
116M |
|
31632 |
123M |
|
31633 |
122M |
|
31634 |
122M |
|
31638 |
122M |
|
33312 |
119,412 |
|
33744 |
174M |
|
40442 |
409,149M |
|
40445 |
409,149M |
|
41281 |
111M |
|
41282 |
111M |
|
47923 |
213,212,166,110,191M |
|