Query time 0.01253
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": 42,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (6058,6061,6063,6062,36729,47902,6057,31628,6056,133,400,6466,25733,3384,135,3743,36728,134,6178,6468,3742,31899,82,31900,38744,3895,25730,405,3744,132,4460,3741)"
}
},
{
"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 |
82 |
122M |
0 |
132 |
122M |
0 |
133 |
122M |
0 |
134 |
122M |
0 |
135 |
122M |
0 |
400 |
122M |
0 |
405 |
122M |
0 |
3384 |
122M |
0 |
3741 |
122M |
0 |
3742 |
122M |
0 |
3743 |
122M |
0 |
3744 |
122M |
0 |
3895 |
122M |
0 |
4460 |
122M |
0 |
6056 |
122M |
0 |
6057 |
122M |
0 |
6058 |
122M |
0 |
6061 |
122M |
0 |
6062 |
122M |
0 |
6063 |
122M |
0 |
6178 |
122M |
0 |
6466 |
122M |
0 |
6468 |
122M |
0 |
25730 |
122M |
0 |
25733 |
122M |
0 |
31628 |
122M |
0 |
31899 |
122M |
0 |
31900 |
122M |
0 |
36728 |
122M |
0 |
36729 |
122M |
0 |
38744 |
122M |
0 |
47902 |
110,214,213,315,119,412,122M |
0 |