Query time 0.00511
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": 37,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (6126,61,62,41831,6539,6162,6163,26930,6168,26931,6167,47905,47164,31666,6160,47900,6166,29740,29738,26967,44761,26932,26866,47901,6161,29742,29741,6096,28243,28244,43663,6190)"
}
},
{
"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 |
61 |
119,118M |
0 |
62 |
119,118M |
0 |
6096 |
118M |
0 |
6126 |
118M |
0 |
6160 |
118M |
0 |
6161 |
118M |
0 |
6162 |
118M |
0 |
6163 |
118M |
0 |
6166 |
118M |
0 |
6167 |
118M |
0 |
6168 |
118M |
0 |
6190 |
118M |
0 |
6539 |
118M |
0 |
26866 |
118M |
0 |
26930 |
118M |
0 |
26931 |
118M |
0 |
26932 |
118M |
0 |
26967 |
118M |
0 |
28243 |
118M |
0 |
28244 |
118M |
0 |
29738 |
118M |
0 |
29740 |
118M |
0 |
29741 |
118M |
0 |
29742 |
118M |
0 |
31666 |
118M |
0 |
41831 |
118M |
0 |
43663 |
118M |
0 |
44761 |
118M |
0 |
47164 |
118M |
0 |
47900 |
119,118M |
0 |
47901 |
119,118M |
0 |
47905 |
214,118M |
0 |