Query time 0.00534
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": 66,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (630,3866,3867,3568,3868,3567,3869,3870,3872,3517,3516,3518,3871,3570,3569,3876,37850,3577,1400,3862,3519,1401,3863,1409,3578,3864,3861,35731,23261,1399,632,3021)"
}
},
{
"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 |
630 |
213,191,409,193M |
|
632 |
150M |
|
1399 |
340,313M |
|
1400 |
340,313M |
|
1401 |
315,340,313M |
|
1409 |
313M |
|
3021 |
340,313M |
|
3516 |
340,313M |
|
3517 |
340,313M |
|
3518 |
340,313M |
|
3519 |
340,313M |
|
3567 |
313M |
|
3568 |
313M |
|
3569 |
340M |
|
3570 |
340M |
|
3577 |
313,340M |
|
3578 |
340M |
|
3861 |
313,166M |
|
3862 |
313,166M |
|
3863 |
313,166M |
|
3864 |
313,166M |
|
3866 |
313,166M |
|
3867 |
313,166M |
|
3868 |
313,166M |
|
3869 |
313,166M |
|
3870 |
313,166M |
|
3871 |
313,166M |
|
3872 |
313,166M |
|
3876 |
313,166M |
|
23261 |
313M |
|
35731 |
313,191M |
|
37850 |
340,313M |
|