Query time 0.00587
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": 57,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (1942,48503,1946,44946,44943,44944,44947,44945,856,6282,6284,1429,6211,31957,4305,28167,33716,3885,51,5628,33717,21680,6212,3886,28165,1901,1899,5619,5621,26977,6286,33718)"
}
},
{
"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 |
51 |
316,317M |
0 |
856 |
315,317,209,142M |
0 |
1429 |
317,318M |
0 |
1899 |
193,317M |
0 |
1901 |
317M |
0 |
1942 |
316,317M |
0 |
1946 |
316,317M |
0 |
3885 |
317M |
0 |
3886 |
317M |
0 |
4305 |
316,317M |
0 |
5619 |
316,317M |
0 |
5621 |
317M |
0 |
5628 |
317M |
0 |
6211 |
317M |
0 |
6212 |
317M |
0 |
6282 |
317,316M |
0 |
6284 |
317,316M |
0 |
6286 |
317,316M |
0 |
21680 |
317,316M |
0 |
26977 |
316,317M |
0 |
28165 |
317M |
0 |
28167 |
317M |
0 |
31957 |
317,193M |
0 |
33716 |
210,317M |
0 |
33717 |
210,317M |
0 |
33718 |
193,317M |
0 |
44943 |
193,317M |
0 |
44944 |
193,317M |
0 |
44945 |
193,317M |
0 |
44946 |
193,317M |
0 |
44947 |
193,317M |
0 |
48503 |
317,210M |
0 |