Query time 0.00145
JSON explain
{
"query_block": {
"select_id": 1,
"cost": 0.068439285,
"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"],
"loops": 1,
"rows": 17,
"cost": 0.018977405,
"filtered": 100,
"attached_condition": "cscart_products_categories.product_id in (19932,18571,19711,19808,19825,19713,19752,19712,18568,18565,18567,18572,18566,19598,19599,19602,18570)",
"using_index": true
}
},
{
"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": ["u508912950_dev_2025.cscart_products_categories.category_id"],
"loops": 17,
"rows": 1,
"cost": 0.01848228,
"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",
"u508912950_dev_2025.cscart_products_categories.product_id"
],
"loops": 17,
"rows": 1,
"cost": 0.02012068,
"filtered": 100
}
}
]
}
}
Result
| product_id |
category_ids |
position |
| 18565 |
1716M |
0 |
| 18566 |
1716M |
0 |
| 18567 |
1716M |
0 |
| 18568 |
1716M |
0 |
| 18570 |
1716M |
0 |
| 18571 |
1716M |
0 |
| 18572 |
1716M |
0 |
| 19598 |
1716M |
0 |
| 19599 |
1716M |
0 |
| 19602 |
1716M |
0 |
| 19711 |
1716M |
0 |
| 19712 |
1716M |
0 |
| 19713 |
1716M |
0 |
| 19752 |
1716M |
0 |
| 19808 |
1716M |
0 |
| 19825 |
1716M |
0 |
| 19932 |
1716M |
0 |