Query time 0.00601
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": 41,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (37849,2653,5288,41437,5826,23169,40809,4795,37881,37300,37296,6371,3640,5770,27056,26849,37294,2297,41358,40754,26856,37302,41418,37284,26851,41368,3464,2300,32360,40807,41387,26857)"
}
},
{
"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 |
2297 |
169M |
|
2300 |
210,412,169M |
|
2653 |
155M |
|
3464 |
181M |
|
3640 |
169,412,210M |
|
4795 |
318M |
|
5288 |
122M |
|
5770 |
184M |
|
5826 |
412,169M |
|
6371 |
174,412M |
|
23169 |
199M |
|
26849 |
117M |
|
26851 |
117M |
|
26856 |
117M |
|
26857 |
117M |
|
27056 |
117M |
|
32360 |
166,313M |
|
37284 |
145M |
|
37294 |
145M |
|
37296 |
145M |
|
37300 |
145M |
|
37302 |
145M |
|
37849 |
313M |
|
37881 |
318M |
|
40754 |
409,183M |
|
40807 |
124M |
|
40809 |
214M |
|
41358 |
145M |
|
41368 |
145M |
|
41387 |
145M |
|
41418 |
141M |
|
41437 |
154M |
|