Query time 0.00297
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": 147,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (49682,49547,49130,49124,50045,49015,49800,49759,49737,49734,49736,50195,49209,49662,50303,50134,50135,50300,50316,49785,50297,49937,50299,50298,50278,49214,50235,50218,49788,50287,50305,50286)"
}
},
{
"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 |
49015 |
213,181M |
|
49124 |
99,210,143M |
|
49130 |
99,210,143M |
|
49209 |
412,119M |
|
49214 |
412,119M |
|
49547 |
409,209,153M |
|
49662 |
209,409,153M |
|
49682 |
409,209,315,210,166M |
|
49734 |
181,169,194M |
|
49736 |
181,105,169M |
|
49737 |
105,181,169M |
|
49759 |
157,210,155M |
|
49785 |
315,210,212,141M |
|
49788 |
315,210,212,141M |
|
49800 |
143M |
|
49937 |
194M |
|
50045 |
409,195,210,209M |
|
50134 |
151,176,212M |
|
50135 |
212,151,176,194M |
|
50195 |
550,412,210,209,110,169M |
|
50218 |
209,210,409,153M |
|
50235 |
409,160M |
|
50278 |
174,412M |
|
50286 |
214,119,412M |
|
50287 |
412M |
|
50297 |
169,412M |
|
50298 |
123,412M |
|
50299 |
412M |
|
50300 |
169,412M |
|
50303 |
169,412M |
|
50305 |
119,412M |
|
50316 |
169,412M |
|