Query time 0.00629
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": 77,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (50216,50194,40927,6372,6358,6357,31633,1975,2305,49192,2303,6354,31965,26895,26894,38797,26872,47567,26871,26876,26870,26874,26878,26885,26875,26879,26884,1972,44424,5141,297,51)"
}
},
{
"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 |
51 |
316,317M |
|
297 |
144M |
|
1972 |
210,213,412,169M |
|
1975 |
169,412,210M |
|
2303 |
210,412,169M |
|
2305 |
169,412,210M |
|
5141 |
169M |
|
6354 |
169,412M |
|
6357 |
122,117,412M |
|
6358 |
412,119M |
|
6372 |
117,169,412M |
|
26870 |
169M |
|
26871 |
169M |
|
26872 |
169M |
|
26874 |
169M |
|
26875 |
169M |
|
26876 |
169M |
|
26878 |
169M |
|
26879 |
169M |
|
26884 |
169M |
|
26885 |
169M |
|
26894 |
169M |
|
26895 |
169M |
|
31633 |
122M |
|
31965 |
210,213,169M |
|
38797 |
213,199M |
|
40927 |
210,412,169M |
|
44424 |
169M |
|
47567 |
122,412M |
|
49192 |
213,210,412,169M |
|
50194 |
550,409,412,210,209,110,169M |
|
50216 |
409,166,165M |
|