Query time 0.01812
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": 38,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (3587,5549,34671,27863,2964,31640,40440,3586,45507,389,1713,44422,2278,3874,2514,2287,5569,46751,6059,48769,31630,6060,4440,18258,14822,18201,2461,31909,31908,2505,4441,6099)"
}
},
{
"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 |
389 |
197M |
|
1713 |
123,340M |
|
2278 |
116M |
|
2287 |
111M |
|
2461 |
169M |
|
2505 |
120M |
|
2514 |
120M |
|
2964 |
120M |
|
3586 |
340M |
|
3587 |
340M |
|
3874 |
313,166M |
|
4440 |
153,195M |
|
4441 |
153,195M |
|
5549 |
123M |
|
5569 |
123M |
|
6059 |
122M |
|
6060 |
122M |
|
6099 |
121M |
|
14822 |
169M |
|
18201 |
122M |
|
18258 |
153,195M |
|
27863 |
169M |
|
31630 |
123M |
|
31640 |
117M |
|
31908 |
122M |
|
31909 |
122M |
|
34671 |
122M |
|
40440 |
409,149M |
|
44422 |
122M |
|
45507 |
197M |
|
46751 |
123M |
|
48769 |
409,340M |
|