Query time 0.00053
JSON explain
{
"query_block": {
"select_id": 1,
"cost": 0.123213634,
"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": 30,
"cost": 0.02494271,
"filtered": 100,
"attached_condition": "cscart_products_categories.product_id in (312926,312901,116529,22384,312928,312930,312931,312929,116423,116425,312436,312019)",
"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": ["u985510652_ecartify.cscart_products_categories.category_id"],
"loops": 30,
"rows": 1,
"cost": 0.0276524,
"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",
"u985510652_ecartify.cscart_products_categories.product_id"
],
"loops": 30,
"rows": 1,
"cost": 0.0514092,
"filtered": 100
}
}
]
}
}
Result
| product_id |
category_ids |
position |
| 22384 |
454,455,458,456M |
0 |
| 116423 |
455,456,457,454M |
0 |
| 116425 |
455,456,457,454M |
0 |
| 116529 |
455,456,458 |
|
| 312019 |
455,456,457,454M |
0 |
| 312436 |
455,456,457,454M |
0 |
| 312901 |
454M |
0 |
| 312926 |
454M |
0 |
| 312928 |
454M |
0 |
| 312929 |
454M |
0 |
| 312930 |
454M |
0 |
| 312931 |
454M |
0 |