Query time 0.00295
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": 47,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (4812,1852,1472,2464,1996,41360,27287,2251,41357,5645,41363,45282,45024,41388,4290,3642,4300,40929,1995,41138,4001,47610,40753,43651,35691,41410,31741,41427,41359,2640,1991,3978)"
}
},
{
"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 |
1472 |
155,156M |
|
1852 |
210,146M |
|
1991 |
210,176M |
|
1995 |
176M |
|
1996 |
210,176M |
|
2251 |
160M |
|
2464 |
169M |
|
2640 |
144M |
|
3642 |
169,412,210M |
|
3978 |
160M |
|
4001 |
155M |
|
4290 |
143M |
|
4300 |
157M |
|
4812 |
317M |
|
5645 |
175M |
|
27287 |
175M |
|
31741 |
156M |
|
35691 |
143M |
|
40753 |
183M |
|
40929 |
169M |
|
41138 |
318M |
|
41357 |
145M |
|
41359 |
145M |
|
41360 |
145M |
|
41363 |
145M |
|
41388 |
145M |
|
41410 |
209,150M |
|
41427 |
210,213,318M |
|
43651 |
409,160M |
|
45024 |
199M |
|
45282 |
210,154M |
|
47610 |
210,212,409,166M |
|