Query time 0.00634
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": 45,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (45504,2563,48770,3882,3176,3666,5408,775,2566,48843,38146,3384,1755,41446,135,41435,2412,5505,16612,31643,313,2321,383,2415,6609,144,33306,1120,19567,4020,4239,5198)"
}
},
{
"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 |
135 |
122M |
|
144 |
111M |
|
313 |
112M |
|
383 |
124M |
|
775 |
107,110,105M |
|
1120 |
178M |
|
1755 |
183M |
|
2321 |
409,152M |
|
2412 |
120M |
|
2415 |
121M |
|
2563 |
121M |
|
2566 |
121M |
|
3176 |
160M |
|
3384 |
122M |
|
3666 |
169,412,210M |
|
3882 |
313,166M |
|
4020 |
119M |
|
4239 |
199M |
|
5198 |
156M |
|
5408 |
157M |
|
5505 |
121M |
|
6609 |
116M |
|
16612 |
123M |
|
19567 |
124M |
|
31643 |
117M |
|
33306 |
116M |
|
38146 |
210,146M |
|
41435 |
154M |
|
41446 |
210,158M |
|
45504 |
197M |
|
48770 |
209,210,176M |
|
48843 |
209,409,153M |
|