Query time 0.00589
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": 94,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (2803,3568,5715,5716,17265,3868,41340,3567,3869,5717,5990,47655,27359,5789,34555,47922,47921,41343,47896,47924,31638,3870,114,47923,1582,33312,31633,31632,3287,3286,3872,113)"
}
},
{
"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 |
113 |
111M |
|
114 |
111M |
|
1582 |
111M |
|
2803 |
210,173M |
|
3286 |
315,412,118,119M |
|
3287 |
315,412,118,119M |
|
3567 |
313M |
|
3568 |
313M |
|
3868 |
313,166M |
|
3869 |
313,166M |
|
3870 |
313,166M |
|
3872 |
313,166M |
|
5715 |
114M |
|
5716 |
114M |
|
5717 |
114M |
|
5789 |
213,210,119,412,114M |
|
5990 |
121M |
|
17265 |
412,122M |
|
27359 |
409,165M |
|
31632 |
123M |
|
31633 |
122M |
|
31638 |
122M |
|
33312 |
119,412 |
|
34555 |
122M |
|
41340 |
191M |
|
41343 |
191M |
|
47655 |
412,110,315,119,210,209,213M |
|
47896 |
212,213,166,110,191M |
|
47921 |
212,213,166,110,191M |
|
47922 |
213,212,166,110,191M |
|
47923 |
213,212,166,110,191M |
|
47924 |
213,212,191,110,166M |
|