Query time 0.00917
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": 47,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (3978,3977,49256,36307,4381,1050,3974,2252,33709,3988,36717,43650,36297,2249,40535,33824,353,36295,33721,34678,2260,36300,40532,40527,41230,25159,33713,49309,3979,36293,18710,33835)"
}
},
{
"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 |
353 |
160M |
0 |
1050 |
160,156M |
0 |
2249 |
160M |
0 |
2252 |
160M |
0 |
2260 |
160M |
0 |
3974 |
160M |
0 |
3977 |
160M |
0 |
3978 |
160M |
0 |
3979 |
160M |
0 |
3988 |
160M |
0 |
4381 |
160M |
0 |
18710 |
160M |
0 |
25159 |
160M |
0 |
33709 |
160M |
0 |
33713 |
160M |
0 |
33721 |
160M |
0 |
33824 |
160M |
0 |
33835 |
160M |
0 |
34678 |
160M |
0 |
36293 |
210,160M |
0 |
36295 |
210,209,160M |
0 |
36297 |
209,210,160M |
0 |
36300 |
210,160M |
0 |
36307 |
210,160M |
0 |
36717 |
210,160M |
0 |
40527 |
160M |
0 |
40532 |
160M |
0 |
40535 |
160M |
0 |
41230 |
160M |
0 |
43650 |
409,160M |
0 |
49256 |
409,210,160M |
0 |
49309 |
160M |
0 |