Query time 0.00249
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 (2016,41444,796,787,2469,3998,48850,41430,4729,2317,33701,37885,23172,18749,4465,18747,4362,4301,2452,2459,2163,5830,1482,3619,4271,5642,1756,1054,2231,47604,36684,41017)"
}
},
{
"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 |
787 |
143,210,144M |
|
796 |
143M |
|
1054 |
160,159M |
|
1482 |
160M |
|
1756 |
183M |
|
2016 |
176M |
|
2163 |
146,318M |
|
2231 |
212,315,409,197M |
|
2317 |
409,152M |
|
2452 |
169M |
|
2459 |
169M |
|
2469 |
169M |
|
3619 |
210,142M |
|
3998 |
155M |
|
4271 |
209,316M |
|
4301 |
157M |
|
4362 |
191M |
|
4465 |
191M |
|
4729 |
195M |
|
5642 |
175M |
|
5830 |
169,412,210M |
|
18747 |
163M |
|
18749 |
163M |
|
23172 |
199M |
|
33701 |
210,145M |
|
36684 |
210,409,160M |
|
37885 |
318M |
|
41017 |
210,143M |
|
41430 |
210,318M |
|
41444 |
154M |
|
47604 |
210,212,166M |
|
48850 |
209,153M |
|