Query time 0.00324
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": 51,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (26868,46144,44931,6165,28238,26867,46142,46145,44930,46148,6148,47898,46149,41952,46147,47165,47166,47897,41955,47167,47668,46146,43662,41954,47664,47168,47665,49394,41953,47667,16567,41956)"
}
},
{
"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 |
6148 |
118M |
0 |
6165 |
118M |
0 |
16567 |
118M |
0 |
26867 |
118M |
0 |
26868 |
118M |
0 |
28238 |
118M |
0 |
41952 |
118M |
0 |
41953 |
118M |
0 |
41954 |
118M |
0 |
41955 |
118M |
0 |
41956 |
118M |
0 |
43662 |
118M |
0 |
44930 |
118M |
0 |
44931 |
118M |
0 |
46142 |
118M |
0 |
46144 |
118M |
0 |
46145 |
118M |
0 |
46146 |
118M |
0 |
46147 |
118M |
0 |
46148 |
118M |
0 |
46149 |
118M |
0 |
47165 |
118M |
0 |
47166 |
118M |
0 |
47167 |
118M |
0 |
47168 |
118M |
0 |
47664 |
119,110,213,118M |
0 |
47665 |
110,119,213,118M |
0 |
47667 |
213,119,110,118M |
0 |
47668 |
110,213,119,118M |
0 |
47897 |
119,213,118M |
0 |
47898 |
118M |
0 |
49394 |
118,95M |
0 |