Query time 0.00339
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 (2474,33695,37944,4808,2744,1064,41370,26867,36295,2158,37307,4872,4806,41356,41373,31945,41369,37299,43461,33698,41366,35690,32307,37292,45569,41402,43842,37281,47622,37286,43841,33700)"
}
},
{
"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 |
1064 |
195M |
|
2158 |
146M |
|
2474 |
181M |
|
2744 |
181M |
|
4806 |
317M |
|
4808 |
317M |
|
4872 |
175M |
|
26867 |
118M |
|
31945 |
117M |
|
32307 |
313,165M |
|
33695 |
145M |
|
33698 |
210,145M |
|
33700 |
145M |
|
35690 |
143M |
|
36295 |
210,209,160M |
|
37281 |
145M |
|
37286 |
145M |
|
37292 |
210,145M |
|
37299 |
145M |
|
37307 |
145M |
|
37944 |
173M |
|
41356 |
145M |
|
41366 |
210,145M |
|
41369 |
145M |
|
41370 |
145M |
|
41373 |
145M |
|
41402 |
143M |
|
43461 |
182M |
|
43841 |
182M |
|
43842 |
182M |
|
45569 |
169M |
|
47622 |
210,183,412,213M |
|