Query time 0.00411
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": 56,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (40437,1896,47632,1893,38074,3288,33310,28159,1894,47631,41345,41341,47597,1767,2139,41340)"
}
},
{
"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 |
1767 |
212,315,409,196M |
|
1893 |
212,315,316,210,409,196M |
|
1894 |
409,196M |
|
1896 |
409,196M |
|
2139 |
116M |
|
3288 |
315,412,118,119M |
|
28159 |
412,119M |
|
33310 |
412,210,209,119M |
|
38074 |
123,209,412,119M |
|
40437 |
409,149M |
|
41340 |
191M |
|
41341 |
191M |
|
41345 |
119,118M |
|
47597 |
210,212,409,166M |
|
47631 |
210,212,409,166M |
|
47632 |
409,210,212,166M |
|