Query time 0.00054
JSON explain
{
"query_block": {
"select_id": 1,
"cost": 0.092641828,
"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": 21,
"cost": 0.023622545,
"filtered": 100,
"attached_condition": "cscart_products_categories.product_id in (312456,312443,312448,312451,312444,312455,312449,312460,461271,461010,461009,312446)",
"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": 21,
"rows": 1,
"cost": 0.01960244,
"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": 21,
"rows": 1,
"cost": 0.03598644,
"filtered": 100
}
}
]
}
}
Result
| product_id |
category_ids |
position |
| 312443 |
461,460M |
0 |
| 312444 |
461,460M |
0 |
| 312446 |
461,460M |
0 |
| 312448 |
461,460M |
0 |
| 312449 |
461,460M |
0 |
| 312451 |
461,460M |
0 |
| 312455 |
461,460M |
0 |
| 312456 |
461,460M |
0 |
| 312460 |
461,460M |
0 |
| 461009 |
461M |
0 |
| 461010 |
461M |
0 |
| 461271 |
461M |
0 |