Query time 0.00409
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": 39,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (2435,41286,6070,2442,35217,335,4452,3499,5228,1663,41549,6371,32712,33291,5818,360,36291,26916,6604,29948,1993,1266,5167,2440,1689,1550,4865,1542,33180,33182,2003,5650)"
}
},
{
"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 |
335 |
174M |
|
360 |
173M |
|
1266 |
172M |
|
1542 |
173M |
|
1550 |
174M |
|
1663 |
172M |
|
1689 |
172M |
|
1993 |
176M |
|
2003 |
176M |
|
2435 |
176M |
|
2440 |
210,176M |
|
2442 |
176M |
|
3499 |
174M |
|
4452 |
172M |
|
4865 |
210,175M |
|
5167 |
174M |
|
5228 |
174M |
|
5650 |
173M |
|
5818 |
341,340,174M |
|
6070 |
175,193M |
|
6371 |
174,412M |
|
6604 |
172M |
|
26916 |
172M |
|
29948 |
174M |
|
32712 |
341,340,174M |
|
33180 |
174M |
|
33182 |
174M |
|
33291 |
173M |
|
35217 |
174M |
|
36291 |
174M |
|
41286 |
172M |
|
41549 |
174M |
|