Query time 0.00065
JSON explain
{
"query_block": {
"select_id": 1,
"cost": 0.122587763,
"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": 24,
"cost": 0.04381364,
"filtered": 100,
"attached_condition": "cscart_products_categories.product_id in (442532,408975,443876,402463,438541,427151,454935,437239,452456,406327,412758,433230,415021,414349,430686,451899,423535,431133,406624,460023,459938,403250,403839,442555)",
"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": 24,
"rows": 1,
"cost": 0.02228576,
"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": 24,
"rows": 1,
"cost": 0.04112736,
"filtered": 100
}
}
]
}
}
Result
| product_id |
category_ids |
position |
| 402463 |
305M |
0 |
| 403250 |
305M |
0 |
| 403839 |
305M |
0 |
| 406327 |
305M |
0 |
| 406624 |
305M |
0 |
| 408975 |
305M |
0 |
| 412758 |
305M |
0 |
| 414349 |
305M |
0 |
| 415021 |
305M |
0 |
| 423535 |
305M |
0 |
| 427151 |
305M |
0 |
| 430686 |
305M |
0 |
| 431133 |
305M |
0 |
| 433230 |
305M |
0 |
| 437239 |
305M |
0 |
| 438541 |
305M |
0 |
| 442532 |
305M |
0 |
| 442555 |
305M |
0 |
| 443876 |
305M |
0 |
| 451899 |
305M |
0 |
| 452456 |
305M |
0 |
| 454935 |
305M |
0 |
| 459938 |
305M |
0 |
| 460023 |
305M |
0 |