Query time 0.00829
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": 46,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (5959,41404,33606,2089,3991,6363,15613,40688,1994,3189,350,48849,5643,4823,3186,298,37295,4264,4298,1044,1746,351,5457,41112,4272,5472,33464,37298,1850,4814,5588,3992)"
}
},
{
"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 |
298 |
166M |
|
350 |
210,160M |
|
351 |
210,160M |
|
1044 |
160,156M |
|
1746 |
183M |
|
1850 |
146M |
|
1994 |
176M |
|
2089 |
161M |
|
3186 |
169M |
|
3189 |
169M |
|
3991 |
157M |
|
3992 |
160M |
|
4264 |
209,316M |
|
4272 |
209,316M |
|
4298 |
143M |
|
4814 |
317M |
|
4823 |
317M |
|
5457 |
191M |
|
5472 |
191M |
|
5588 |
191M |
|
5643 |
175M |
|
5959 |
191M |
|
6363 |
169,213,412,210,119M |
|
15613 |
146,318M |
|
33464 |
199M |
|
33606 |
313,191M |
|
37295 |
145M |
|
37298 |
145M |
|
40688 |
212M |
|
41112 |
318M |
|
41404 |
143M |
|
48849 |
209,409,153M |
|