Query time 0.00273
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": 50,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (3884,382,3875,2294,112,3471,3880,3877,49265,3859,3879,3881,23162,3860,6089,1781,384,3883,385,3882,1755,383,4020,1754,4493,41398,52,41399,5581,5577,4500,1059)"
}
},
{
"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 |
52 |
155M |
|
112 |
111M |
|
382 |
114M |
|
383 |
124M |
|
384 |
124M |
|
385 |
114M |
|
1059 |
166M |
|
1754 |
183M |
|
1755 |
183M |
|
1781 |
313M |
|
2294 |
120M |
|
3471 |
313M |
|
3859 |
313,166M |
|
3860 |
313,166M |
|
3875 |
313,166M |
|
3877 |
313,166M |
|
3879 |
313,166M |
|
3880 |
313,166M |
|
3881 |
313,166M |
|
3882 |
313,166M |
|
3883 |
313,166M |
|
3884 |
313,166M |
|
4020 |
119M |
|
4493 |
199M |
|
4500 |
199M |
|
5577 |
191M |
|
5581 |
191M |
|
6089 |
412,119M |
|
23162 |
209,160M |
|
41398 |
144M |
|
41399 |
144M |
|
49265 |
409,160M |
|