Query time 0.00354
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": 58,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (319,35249,41441,33177,4004,3764,858,857,33214,41442,466,3916,47085,6556,462,4367,1892,225,5455,33716,3917,35734,33717,36781,41446,41435,4266,2280,6468,41422,2253,41443)"
}
},
{
"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 |
225 |
105,107,110,166M |
|
319 |
154M |
|
462 |
201M |
|
466 |
201,212M |
|
857 |
209,210,142M |
|
858 |
209,210,315,142M |
|
1892 |
212,315,210,209,409,196M |
|
2253 |
154M |
|
2280 |
166M |
|
3764 |
211,215M |
|
3916 |
318M |
|
3917 |
318M |
|
4004 |
157M |
|
4266 |
209,316M |
|
4367 |
191M |
|
5455 |
191M |
|
6468 |
122M |
|
6556 |
183M |
|
33177 |
210,158M |
|
33214 |
158M |
|
33716 |
210,317M |
|
33717 |
210,317M |
|
35249 |
409,154M |
|
35734 |
168,142M |
|
36781 |
318M |
|
41422 |
318M |
|
41435 |
154M |
|
41441 |
154M |
|
41442 |
154M |
|
41443 |
154M |
|
41446 |
210,158M |
|
47085 |
210,146M |
|