Query time 0.00204
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": 109,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (49541,49543,48864,48865,48862,48863,49160,48856,48660,48835,48860,49153,48663,49125,47503,49542,49158,49126,49122,48496,49155,49163,49504,49154,49127,49162,49129,49131,49161,49157,48662,48659)"
}
},
{
"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 |
47503 |
145M |
|
48496 |
210,144M |
|
48659 |
212,213,149M |
|
48660 |
212,213,149M |
|
48662 |
212,213,149M |
|
48663 |
212,213,149M |
|
48835 |
210,151M |
|
48856 |
211,210,145M |
|
48860 |
210,211,145M |
|
48862 |
211,210,145M |
|
48863 |
211,166,151M |
|
48864 |
211,319,145M |
|
48865 |
211,145M |
|
49122 |
151,209,99M |
0 |
49125 |
99,210,110,144M |
0 |
49126 |
99,210,144M |
0 |
49127 |
99,210,143M |
0 |
49129 |
99,210,143M |
0 |
49131 |
99,210,142M |
0 |
49153 |
213,210,99,151M |
0 |
49154 |
213,99,210,151M |
0 |
49155 |
210,213,99,150M |
0 |
49157 |
99,213,210,151M |
0 |
49158 |
99,213,210,151M |
0 |
49160 |
213,99,151,210,150M |
0 |
49161 |
210,213,99,150M |
0 |
49162 |
99,213,210,151M |
0 |
49163 |
99,210,213,144M |
0 |
49504 |
209,409,153M |
|
49541 |
409,209,153M |
|
49542 |
409,209,153M |
|
49543 |
409,209,153M |
|