Query time 0.00548
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": 120,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (48655,48816,48818,49221,48821,48819,48820,48812,48328,29735,48531,49005,48329,49011,49016,48327,49007,50045,50193,49737,49734,49736,50303,50201,50200,50348,50299,49931,50264,50287,50314,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 |
29735 |
169M |
|
48327 |
210,213,169M |
|
48328 |
210,213,169M |
|
48329 |
210,213,169M |
|
48531 |
199M |
|
48655 |
213,212,199M |
|
48812 |
195M |
|
48816 |
166,195M |
|
48818 |
166,195,212M |
|
48819 |
166,212,195M |
|
48820 |
195,212,166M |
|
48821 |
195,212,166M |
|
49005 |
169,412M |
|
49007 |
213,110,412,210M |
|
49011 |
169,412M |
|
49016 |
412M |
|
49221 |
211,210,209,409,412,119M |
|
49734 |
181,169,194M |
|
49736 |
181,105,169M |
|
49737 |
105,181,169M |
|
49931 |
166,199,101M |
|
50045 |
409,195,210,209M |
|
50193 |
550,412,210,209,110,169M |
|
50200 |
550,412,169M |
|
50201 |
550,412,210,209,110,169M |
|
50264 |
169M |
|
50286 |
214,119,412M |
|
50287 |
412M |
|
50299 |
412M |
|
50303 |
169,412M |
|
50314 |
169,412M |
|
50348 |
409,195M |
|