Query time 0.00423
JSON explain
{
"query_block": {
"select_id": 1,
"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"],
"rows": 30,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (20838,41136,41146,2623,37897,37890,41126,41107,41129,41425,36522,44552,47432,36520,37891,37883,27368,37884,41132,41118,41120,37893,41109,47433,47415,47430)"
}
},
{
"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": ["dev_db.cscart_products_categories.category_id"],
"rows": 1,
"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", "dev_db.cscart_products_categories.product_id"],
"rows": 1,
"filtered": 100
}
}
]
}
}
Result
product_id |
category_ids |
position |
2623 |
146,318M |
0 |
20838 |
146,318M |
0 |
27368 |
318M |
0 |
36520 |
318M |
0 |
36522 |
145,318M |
0 |
37883 |
318M |
0 |
37884 |
318M |
0 |
37890 |
318M |
0 |
37891 |
318M |
0 |
37893 |
318M |
0 |
37897 |
318M |
0 |
41107 |
318M |
0 |
41109 |
318M |
0 |
41118 |
318M |
0 |
41120 |
318M |
0 |
41126 |
318M |
0 |
41129 |
318M |
0 |
41132 |
318M |
0 |
41136 |
318M |
0 |
41146 |
318M |
0 |
41425 |
318M |
0 |
44552 |
317,318M |
0 |
47415 |
318M |
0 |
47430 |
318M |
0 |
47432 |
318M |
0 |
47433 |
318M |
0 |