Query time 0.01873
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": 41,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (2465,5625,2233,3714,4192,2232,2081,1749,3843,3260,31608,2575,6140,2469,6617,4140,5809,2496,5620,880,23172,635,49346,1260,3611,4465,4362,6125,5913,2452,2689,2459)"
}
},
{
"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 |
635 |
149M |
|
880 |
181M |
|
1260 |
197M |
|
1749 |
183M |
|
2081 |
211,215M |
|
2232 |
213,212M |
|
2233 |
315,212,197M |
|
2452 |
169M |
|
2459 |
169M |
|
2465 |
169M |
|
2469 |
169M |
|
2496 |
169M |
|
2575 |
169M |
|
2689 |
111M |
|
3260 |
124M |
|
3611 |
144M |
|
3714 |
210,144M |
|
3843 |
181M |
|
4140 |
412,119M |
|
4192 |
169,412,210M |
|
4362 |
191M |
|
4465 |
191M |
|
5620 |
317M |
|
5625 |
317M |
|
5809 |
114M |
|
5913 |
124M |
|
6125 |
118M |
|
6140 |
111M |
|
6617 |
116M |
|
23172 |
199M |
|
31608 |
111M |
|
49346 |
184M |
|