Query time 0.01148
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": 40,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (3516,33744,1980,31634,3518,40442,31631,31639,15462,2289,3570,3569,31636,1979,1088,398,1981,31637,5278,1277,31635,1580,3876,120,40443,37850,3577,41590,40149,2290,34674,34668)"
}
},
{
"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 |
120 |
122M |
|
398 |
123M |
|
1088 |
151M |
|
1277 |
123M |
|
1580 |
122M |
|
1979 |
122M |
|
1980 |
122M |
|
1981 |
122M |
|
2289 |
116M |
|
2290 |
172M |
|
3516 |
340,313M |
|
3518 |
340,313M |
|
3569 |
340M |
|
3570 |
340M |
|
3577 |
313,340M |
|
3876 |
313,166M |
|
5278 |
122M |
|
15462 |
116M |
|
31631 |
123M |
|
31634 |
122M |
|
31635 |
122M |
|
31636 |
122M |
|
31637 |
122M |
|
31639 |
117M |
|
33744 |
174M |
|
34668 |
122M |
|
34674 |
122M |
|
37850 |
340,313M |
|
40149 |
153,195M |
|
40442 |
409,149M |
|
40443 |
409,149M |
|
41590 |
114M |
|