Query time 0.01362
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": 49,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (2904,5582,22143,4269,1059,718,3770,33727,16399,4270,3669,22534,1041,35188,25850,4193,4073,31949,6196,47009,222,18160,3975,2257,1835,4070,1356,6648,48772,38552,20804,34553)"
}
},
{
"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 |
222 |
319M |
|
718 |
156M |
|
1041 |
156,159M |
|
1059 |
166M |
|
1356 |
151M |
|
1835 |
160M |
|
2257 |
154M |
|
2904 |
155M |
|
3669 |
412,210M |
|
3770 |
157M |
|
3975 |
160M |
|
4070 |
155M |
|
4073 |
155M |
|
4193 |
169,412,210M |
|
4269 |
209,316M |
|
4270 |
209,316M |
|
5582 |
211,319M |
|
6196 |
341,340,174M |
|
6648 |
318M |
|
16399 |
157M |
|
18160 |
211,215M |
|
20804 |
145M |
|
22143 |
213,210,169M |
|
22534 |
166M |
|
25850 |
160M |
|
31949 |
156M |
|
33727 |
154M |
|
34553 |
107,201M |
|
35188 |
409,154M |
|
38552 |
160,159M |
|
47009 |
158M |
|
48772 |
149,409,99M |
|