Query time 0.00282
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": 53,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (398,1981,1716,40446,31637,5278,855,1277,5786,47020,47023,41339,47022,31635,1580,3876,1975,48980,120,43824,40443,27353,37850,2873,3577,2854,1538,3713,41590,40149,6369,2290)"
}
},
{
"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 |
|
855 |
142M |
|
1277 |
123M |
|
1538 |
117M |
|
1580 |
122M |
|
1716 |
123M |
|
1975 |
169,412,210M |
|
1981 |
122M |
|
2290 |
172M |
|
2854 |
193M |
|
2873 |
193M |
|
3577 |
313,340M |
|
3713 |
412,210M |
|
3876 |
313,166M |
|
5278 |
122M |
|
5786 |
114M |
|
6369 |
169,412M |
|
27353 |
409,165M |
|
31635 |
122M |
|
31637 |
122M |
|
37850 |
340,313M |
|
40149 |
153,195M |
|
40443 |
409,149M |
|
40446 |
409,149M |
|
41339 |
191M |
|
41590 |
114M |
|
43824 |
122M |
|
47020 |
142M |
|
47022 |
209,210,142M |
|
47023 |
99,142,209,210M |
|
48980 |
550,155,210,110,100,161M |
|