Query time 0.00274
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": 94,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (48839,630,41341,41340,47922,47921,41343,47896,47924,47923,41339,35730,35731,631,2085,4367,35729,5455,637,5581,5577,31872,35859,5461,5958,5476,189,4465,4362,33606,5959,47895)"
}
},
{
"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 |
189 |
211,191M |
0 |
630 |
213,191,409,193M |
0 |
631 |
409,213,191,412,193M |
0 |
637 |
213,191,409,193M |
0 |
2085 |
110,107,105,191M |
0 |
4362 |
191M |
0 |
4367 |
191M |
0 |
4465 |
191M |
0 |
5455 |
191M |
0 |
5461 |
191M |
0 |
5476 |
191M |
0 |
5577 |
191M |
0 |
5581 |
191M |
0 |
5958 |
191M |
0 |
5959 |
191M |
0 |
31872 |
191M |
0 |
33606 |
313,191M |
0 |
35729 |
313,191M |
0 |
35730 |
313,191M |
0 |
35731 |
313,191M |
0 |
35859 |
313,191M |
0 |
41339 |
191M |
0 |
41340 |
191M |
0 |
41341 |
191M |
0 |
41343 |
191M |
0 |
47895 |
213,166,212,110,191M |
0 |
47896 |
212,213,166,110,191M |
0 |
47921 |
212,213,166,110,191M |
0 |
47922 |
213,212,166,110,191M |
0 |
47923 |
213,212,166,110,191M |
0 |
47924 |
213,212,191,110,166M |
0 |
48839 |
550,409,191,166,213M |
0 |