Query time 0.00753
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": 140,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (35279,25318,47597,47084,5787,1767,18608,1057,5790,33723,2803,17265,47655,5789,47922,47921,47896,47924,47923,33312,3287,3286,3872,5300,5297,1579,65,1587,47024,1102,41293,17259)"
}
},
{
"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 |
65 |
412,119,118M |
|
1057 |
210,209,409,160M |
|
1102 |
122M |
|
1579 |
122M |
|
1587 |
116M |
|
1767 |
212,315,409,196M |
|
2803 |
210,173M |
|
3286 |
315,412,118,119M |
|
3287 |
315,412,118,119M |
|
3872 |
313,166M |
|
5297 |
122,412 |
|
5300 |
122,412 |
|
5787 |
213,210,412,114M |
|
5789 |
213,210,119,412,114M |
|
5790 |
213,210,119,412,114M |
|
17259 |
412,122M |
|
17265 |
412,122M |
|
18608 |
110,163,166,318M |
0 |
25318 |
101,166,213,195,409,193M |
|
33312 |
119,412 |
|
33723 |
209,409,160M |
|
35279 |
340,409 |
|
41293 |
209,210,142M |
|
47024 |
142,209,210M |
|
47084 |
110,409,149M |
0 |
47597 |
210,212,409,166M |
|
47655 |
412,110,315,119,210,209,213M |
0 |
47896 |
212,213,166,110,191M |
0 |
47921 |
212,213,166,110,191M |
0 |
47922 |
213,212,166,110,191M |
0 |
47923 |
213,212,166,110,191M |
0 |
47924 |
213,212,191,110,166M |
0 |