Query time 0.00365
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": 106,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (1773,2707,276,1431,1768,1775,1432,1430,1774,1769,1772,1770,1771,1777,47878,47876,47874,47875,47869,47877,47873,47871,47872,47870)"
}
},
{
"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 |
276 |
317,319,320,316M |
0 |
1430 |
320,319M |
0 |
1431 |
320,319M |
0 |
1432 |
320,317M |
0 |
1768 |
319,412,320M |
0 |
1769 |
412,320M |
0 |
1770 |
319,412,320M |
0 |
1771 |
319,412,320M |
0 |
1772 |
320,412,319M |
0 |
1773 |
318,412,320M |
0 |
1774 |
320,412,319M |
0 |
1775 |
320,412,319M |
0 |
1777 |
412,320,319M |
0 |
2707 |
320M |
0 |
47869 |
212,213,211,210,319,412,320M |
0 |
47870 |
110,320,190,210,211,412,319M |
0 |
47871 |
110,104,190,320,210,211,412,319M |
0 |
47872 |
110,211,210,104,190,319,412,320M |
0 |
47873 |
110,210,104,190,319,412,320M |
0 |
47874 |
110,210,104,190,319,412,320M |
0 |
47875 |
190,104,110,210,319,412,320M |
0 |
47876 |
104,210,110,319,412,320M |
0 |
47877 |
110,210,104,319,412,320M |
0 |
47878 |
104,110,210,211,319,412,320M |
0 |