Query time 0.00249
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": 45,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (35839,35731,631,4367,5455,5581,5577,35869,5461,5958,5476,33631,5959,5472,5457,5462,5960,5957,5961,16802,35733,5448,4363,5956,5451,5963,5447,4365,5469,4468,5464,5474)"
}
},
{
"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 |
631 |
409,213,191,412,193M |
0 |
4363 |
191M |
0 |
4365 |
191M |
0 |
4367 |
191M |
0 |
4468 |
191M |
0 |
5447 |
191M |
0 |
5448 |
191M |
0 |
5451 |
191M |
0 |
5455 |
191M |
0 |
5457 |
191M |
0 |
5461 |
191M |
0 |
5462 |
191M |
0 |
5464 |
191M |
0 |
5469 |
191M |
0 |
5472 |
191M |
0 |
5474 |
191M |
0 |
5476 |
191M |
0 |
5577 |
191M |
0 |
5581 |
191M |
0 |
5956 |
191M |
0 |
5957 |
191M |
0 |
5958 |
191M |
0 |
5959 |
191M |
0 |
5960 |
191M |
0 |
5961 |
191M |
0 |
5963 |
191M |
0 |
16802 |
191M |
0 |
33631 |
313,191M |
0 |
35731 |
313,191M |
0 |
35733 |
313,191M |
0 |
35839 |
313,191M |
0 |
35869 |
313,191M |
0 |