Query time 0.00291
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": 53,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (18201,40824,41441,6099,49306,1897,401,27360,6058,41442,6061,40761,2471,6063,5890,6062,41170,1429,5834,6057,47085,3471,4280,27362,31642,6556,36399,5894,47660,6056,6561,4894)"
}
},
{
"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 |
401 |
122M |
|
1429 |
317,318M |
|
1897 |
142M |
|
2471 |
163M |
|
3471 |
313M |
|
4280 |
184M |
|
4894 |
183,209,412,210M |
|
5834 |
121M |
|
5890 |
114M |
|
5894 |
114M |
|
6056 |
122M |
|
6057 |
122M |
|
6058 |
122M |
|
6061 |
122M |
|
6062 |
122M |
|
6063 |
122M |
|
6099 |
121M |
|
6556 |
183M |
|
6561 |
184,183M |
|
18201 |
122M |
|
27360 |
409,165M |
|
27362 |
409,165M |
|
31642 |
117M |
|
36399 |
163M |
|
40761 |
315,119,412,118M |
|
40824 |
409,184M |
|
41170 |
118M |
|
41441 |
154M |
|
41442 |
154M |
|
47085 |
210,146M |
|
47660 |
412,119M |
|
49306 |
409,209,210,154M |
|