Query time 0.00114
JSON explain
{
"query_block": {
"select_id": 1,
"cost": 0.085634965,
"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.029619485,
"filtered": 100,
"attached_condition": "cscart_products_categories.product_id in (17,171996,121248,143251,162699,121501,177837,131575,135087,155693,137836,134775,170928,172389,158791,123506)",
"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_abhi.cscart_products_categories.category_id"
],
"loops": 17,
"rows": 1,
"cost": 0.01602468,
"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_abhi.cscart_products_categories.product_id"
],
"loops": 17,
"rows": 1,
"cost": 0.02913188,
"filtered": 100
}
}
]
}
}
Result
| product_id |
category_ids |
position |
| 17 |
307,235M |
0 |
| 121248 |
308M |
|
| 121501 |
308M |
|
| 123506 |
308M |
|
| 131575 |
308M |
|
| 134775 |
308M |
|
| 135087 |
308M |
|
| 137836 |
308M |
|
| 143251 |
308M |
|
| 155693 |
308M |
|
| 158791 |
308M |
|
| 162699 |
308M |
|
| 170928 |
308M |
|
| 171996 |
308M |
|
| 172389 |
308M |
|
| 177837 |
308M |
|