Query time 0.00421
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": 76,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (33725,854,33724,856,34053,858,462,35734,6468,1750,6545,4271,5769,4272,1751,461,4268,4267,5775,41616,5771,41226,5768,33721,1753,35475,40312,47855,35470,35471,49290,48939)"
}
},
{
"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 |
461 |
201,212M |
|
462 |
201M |
|
854 |
168,142,209,210M |
|
856 |
315,317,209,142M |
|
858 |
209,210,315,142M |
|
1750 |
183M |
|
1751 |
183M |
|
1753 |
183M |
|
4267 |
209,316M |
|
4268 |
209,316M |
|
4271 |
209,316M |
|
4272 |
209,316M |
|
5768 |
315,213,210,184M |
|
5769 |
213,184M |
|
5771 |
184M |
|
5775 |
315,184M |
|
6468 |
122M |
|
6545 |
213,412,119M |
|
33721 |
160M |
|
33724 |
409,160M |
|
33725 |
209,409,160M |
|
34053 |
409,160M |
|
35470 |
168,142M |
|
35471 |
142M |
|
35475 |
142M |
|
35734 |
168,142M |
|
40312 |
194M |
|
41226 |
120M |
|
41616 |
120M |
|
47855 |
213,110,201M |
|
48939 |
209,110,201,105M |
|
49290 |
412,315,213,96M |
|