Query time 0.00211
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": 38,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (41594,2460,43670,20588,3437,2018,2443,2497,5416,5418,2911,3196,1661,3223,4074,14985,1056,2466,5402,3747,2465,1875,1098,3990,4192,33703,2081,4883,37282,2016,2575,2469)"
}
},
{
"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 |
1056 |
210,209,409,160M |
|
1098 |
155M |
|
1661 |
172M |
|
1875 |
157M |
|
2016 |
176M |
|
2018 |
176M |
|
2081 |
211,215M |
|
2443 |
176M |
|
2460 |
169M |
|
2465 |
169M |
|
2466 |
169M |
|
2469 |
169M |
|
2497 |
169M |
|
2575 |
169M |
|
2911 |
169M |
|
3196 |
169M |
|
3223 |
157M |
|
3437 |
144M |
|
3747 |
215M |
|
3990 |
155M |
|
4074 |
155M |
|
4192 |
169,412,210M |
|
4883 |
176M |
|
5402 |
157M |
|
5416 |
157M |
|
5418 |
158M |
|
14985 |
144M |
|
20588 |
142M |
|
33703 |
145M |
|
37282 |
145M |
|
41594 |
169M |
|
43670 |
143M |
|