Query time 0.00827
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": 54,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (5300,3517,5991,3516,33744,5297,1980,1103,65,31634,35782,5784,3518,40445,40442,31631,31639,22172,15462,47024,1278,2289,1102,3871,3570,3569,31636,1104,1979,1088,41293,17259)"
}
},
{
"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 |
65 |
412,119,118M |
|
1088 |
151M |
|
1102 |
122M |
|
1103 |
122M |
|
1104 |
122M |
|
1278 |
143M |
|
1979 |
122M |
|
1980 |
122M |
|
2289 |
116M |
|
3516 |
340,313M |
|
3517 |
340,313M |
|
3518 |
340,313M |
|
3569 |
340M |
|
3570 |
340M |
|
3871 |
313,166M |
|
5297 |
122,412 |
|
5300 |
122,412 |
|
5784 |
114M |
|
5991 |
121M |
|
15462 |
116M |
|
17259 |
412,122M |
|
22172 |
146M |
|
31631 |
123M |
|
31634 |
122M |
|
31636 |
122M |
|
31639 |
117M |
|
33744 |
174M |
|
35782 |
409,169M |
|
40442 |
409,149M |
|
40445 |
409,149M |
|
41293 |
209,210,142M |
|
47024 |
142,209,210M |
|