Query time 0.01282
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 (46735,14822,18201,2461,41441,31909,40824,5554,31908,2505,4441,6099,5779,34672,23406,33177,4004,47018,36733,49306,1897,3764,401,858,3774,2113,27360,857,6577,33214,4238,46181)"
}
},
{
"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 |
401 |
122M |
|
857 |
209,210,142M |
|
858 |
209,210,315,142M |
|
1897 |
142M |
|
2113 |
123M |
|
2461 |
169M |
|
2505 |
120M |
|
3764 |
211,215M |
|
3774 |
155M |
|
4004 |
157M |
|
4238 |
199M |
|
4441 |
153,195M |
|
5554 |
123M |
|
5779 |
209,210,213,412,114M |
|
6099 |
121M |
|
6577 |
169M |
|
14822 |
169M |
|
18201 |
122M |
|
23406 |
212M |
|
27360 |
409,165M |
|
31908 |
122M |
|
31909 |
122M |
|
33177 |
210,158M |
|
33214 |
158M |
|
34672 |
122M |
|
36733 |
340M |
|
40824 |
409,184M |
|
41441 |
154M |
|
46181 |
153,195M |
|
46735 |
123M |
|
47018 |
141M |
|
49306 |
409,209,210,154M |
|