Query time 0.00423
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": 35,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (4373,36464,5575,976,5636,4379,6476,3995,38561,21746,23481,16847,1051,36474,3224,2653,975,5726,41437,16416,28162,5405,1358,3989,6470,38136,32286,4372,285,1166,5414,38551)"
}
},
{
"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 |
285 |
157M |
|
975 |
155M |
|
976 |
155M |
|
1051 |
156M |
|
1166 |
159M |
|
1358 |
160M |
|
2653 |
155M |
|
3224 |
157M |
|
3989 |
157M |
|
3995 |
158M |
|
4372 |
159M |
|
4373 |
160M |
|
4379 |
161M |
|
5405 |
157M |
|
5414 |
157M |
|
5575 |
155M |
|
5636 |
154M |
|
5726 |
157M |
|
6470 |
161M |
|
6476 |
155M |
|
16416 |
155M |
|
16847 |
157M |
|
21746 |
156M |
|
23481 |
209,160M |
|
28162 |
156M |
|
32286 |
157M |
|
36464 |
210,154,156M |
|
36474 |
160M |
|
38136 |
160M |
|
38551 |
156M |
|
38561 |
155M |
|
41437 |
154M |
|