Query time 0.00234
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": 70,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (1893,1773,18608,1942,48503,1946,44946,44943,44944,44947,44945,41429,2157,856,41123,36329,6282,6284,41421,3916,1429,6211,31957,4305,28167,33716,3885,51,3917,36339,5628,6050)"
}
},
{
"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 |
|
856 |
315,317,209,142M |
|
1429 |
317,318M |
|
1773 |
318,412,320M |
|
1893 |
212,315,316,210,409,196M |
|
1942 |
316,317M |
|
1946 |
316,317M |
|
2157 |
210,146,318M |
|
3885 |
317M |
|
3916 |
318M |
|
3917 |
318M |
|
4305 |
316,317M |
|
5628 |
317M |
|
6050 |
145,318,412,210M |
|
6211 |
317M |
|
6282 |
317,316M |
|
6284 |
317,316M |
|
18608 |
110,163,166,318M |
|
28167 |
317M |
|
31957 |
317,193M |
|
33716 |
210,317M |
|
36329 |
163,318M |
|
36339 |
163,318M |
|
41123 |
318M |
|
41421 |
318M |
|
41429 |
213,210,318M |
|
44943 |
193,317M |
|
44944 |
193,317M |
|
44945 |
193,317M |
|
44946 |
193,317M |
|
44947 |
193,317M |
|
48503 |
317,210M |
|