Query time 0.01322
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": 56,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (27946,3525,3523,2949,3534,1404,33606,2936,2968,5777,2944,5776,32317,2919,3019,2868,37849,1407,2864,3408,3412,1417,32328,3025,1406,32360,3409,19210,27927,35733,32319,1419)"
}
},
{
"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 |
1404 |
313M |
0 |
1406 |
313M |
0 |
1407 |
313M |
0 |
1417 |
313M |
0 |
1419 |
340,313M |
0 |
2864 |
340,313M |
0 |
2868 |
340,313M |
0 |
2919 |
313M |
0 |
2936 |
340,313M |
0 |
2944 |
313,340M |
0 |
2949 |
340,313M |
0 |
2968 |
340,313M |
0 |
3019 |
340,313M |
0 |
3025 |
340,313M |
0 |
3408 |
340,313M |
0 |
3409 |
313M |
0 |
3412 |
340,313M |
0 |
3523 |
313M |
0 |
3525 |
340,313M |
0 |
3534 |
313M |
0 |
5776 |
166,340,313M |
0 |
5777 |
313M |
0 |
19210 |
340,313M |
0 |
27927 |
313M |
0 |
27946 |
313,166M |
0 |
32317 |
110,211,313M |
0 |
32319 |
313,166M |
0 |
32328 |
313,211,165M |
0 |
32360 |
166,313M |
0 |
33606 |
313,191M |
0 |
35733 |
313,191M |
0 |
37849 |
313M |
0 |