Query time 0.00058
JSON explain
{
"query_block": {
"select_id": 1,
"cost": 0.170833772,
"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": 44,
"cost": 0.0269963,
"filtered": 100,
"attached_condition": "cscart_products_categories.product_id in (116529,22384,116423,116425,312436,312019,116427,116525,116539,116517,312888,390924)",
"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": 44,
"rows": 1,
"cost": 0.04017456,
"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": 44,
"rows": 1,
"cost": 0.07540016,
"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 |
| 116427 |
455,456,457,454M |
0 |
| 116517 |
455,456,458,454M |
0 |
| 116525 |
455,456,458,454M |
0 |
| 116529 |
455,456,458 |
0 |
| 116539 |
454,455,458,456M |
0 |
| 312019 |
455,456,457,454M |
0 |
| 312436 |
455,456,457,454M |
0 |
| 312888 |
459,454M |
|
| 390924 |
459,454M |
|