Query time 0.00388
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": 37,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (34672,36733,1897,401,6577,6058,46181,1412,3585,1121,6061,382,2502,2136,2961,6063,2132,5890,3875,6062,44939,3230,112,2286,6057,5567,5141,6052,4280,3880,31642,2513)"
}
},
{
"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 |
112 |
111M |
|
382 |
114M |
|
401 |
122M |
|
1121 |
178M |
|
1412 |
313M |
|
1897 |
142M |
|
2132 |
120M |
|
2136 |
120M |
|
2286 |
116M |
|
2502 |
121M |
|
2513 |
120M |
|
2961 |
120M |
|
3230 |
157M |
|
3585 |
313,340M |
|
3875 |
313,166M |
|
3880 |
313,166M |
|
4280 |
184M |
|
5141 |
169M |
|
5567 |
123M |
|
5890 |
114M |
|
6052 |
124M |
|
6057 |
122M |
|
6058 |
122M |
|
6061 |
122M |
|
6062 |
122M |
|
6063 |
122M |
|
6577 |
169M |
|
31642 |
117M |
|
34672 |
122M |
|
36733 |
340M |
|
44939 |
141M |
|
46181 |
153,195M |
|