Query time 0.00891
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": 101,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (1896,50216,27361,35256,47632,1893,47593,49169,47613,48823,46585,6091,6370,47903,1894,23152,47631,1533,49873,6358,6357,47597,5503,18608,42255,40350,1057,2803,3568,17265,3567,5990)"
}
},
{
"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 |
1057 |
210,209,409,160M |
|
1533 |
118M |
|
1893 |
212,315,316,210,409,196M |
|
1894 |
409,196M |
|
1896 |
409,196M |
|
2803 |
210,173M |
|
3567 |
313M |
|
3568 |
313M |
|
5503 |
121M |
|
5990 |
121M |
|
6091 |
315,412,119M |
|
6357 |
122,117,412M |
|
6358 |
412,119M |
|
6370 |
117,412,119M |
|
17265 |
412,122M |
|
18608 |
110,163,166,318M |
|
23152 |
409,340M |
|
27361 |
409,210,165M |
|
35256 |
210,209,409,154M |
|
40350 |
409,169M |
|
42255 |
409,169M |
|
46585 |
210,412,169M |
|
47593 |
210,212,166M |
|
47597 |
210,212,409,166M |
|
47613 |
210,212,166M |
|
47631 |
210,212,409,166M |
|
47632 |
409,210,212,166M |
|
47903 |
110,213,315,119,412,214M |
|
48823 |
550,409,210,209,183M |
|
49169 |
409,160M |
|
49873 |
409,184M |
|
50216 |
409,166,165M |
|