Query time 0.00774
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": 36,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (37300,4795,38150,37296,26849,27056,37294,41358,26856,37302,37284,41368,3464,4865,41387,31645,41367,37942,41134,4793,41102,37289,5761,37943,37301,32319,923,610,36303,38148,37297,33696)"
}
},
{
"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 |
610 |
174M |
|
923 |
181M |
|
3464 |
181M |
|
4793 |
318M |
|
4795 |
318M |
|
4865 |
210,175M |
|
5761 |
184M |
|
26849 |
117M |
|
26856 |
117M |
|
27056 |
117M |
|
31645 |
117M |
|
32319 |
313,166M |
|
33696 |
145M |
|
36303 |
210,409,160M |
|
37284 |
145M |
|
37289 |
145M |
|
37294 |
145M |
|
37296 |
145M |
|
37297 |
145M |
|
37300 |
145M |
|
37301 |
145M |
|
37302 |
145M |
|
37942 |
173M |
|
37943 |
173M |
|
38148 |
146M |
|
38150 |
146M |
|
41102 |
318M |
|
41134 |
318M |
|
41358 |
145M |
|
41367 |
145M |
|
41368 |
145M |
|
41387 |
145M |
|