Query time 0.01577
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": 55,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (2925,2930,2133,2508,33747,39613,18260,6556,462,263,2966,3877,40454,5894,2085,4367,47660,264,2135,2087,31628,4332,40453,6561,4894,2507,49265,31957,3859,21065,3470,5896)"
}
},
{
"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 |
263 |
116M |
|
264 |
116M |
|
462 |
201M |
|
2085 |
110,107,105,191M |
|
2087 |
155M |
|
2133 |
120M |
|
2135 |
120M |
|
2507 |
120M |
|
2508 |
120M |
|
2925 |
340,313M |
|
2930 |
340,313M |
|
2966 |
120M |
|
3470 |
123M |
|
3859 |
313,166M |
|
3877 |
313,166M |
|
4332 |
165M |
|
4367 |
191M |
|
4894 |
183,209,412,210M |
|
5894 |
114M |
|
5896 |
114M |
|
6556 |
183M |
|
6561 |
184,183M |
|
18260 |
153,195M |
|
21065 |
120M |
|
31628 |
122M |
|
31957 |
317,193M |
|
33747 |
174M |
|
39613 |
409,195M |
|
40453 |
315,209,409,153M |
|
40454 |
315,209,409,153M |
|
47660 |
412,119M |
|
49265 |
409,160M |
|