Query time 0.00495
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 (3988,36717,2249,3986,1471,36297,43650,46273,40535,43655,31879,36468,353,6518,36295,4369,41438,4377,33721,3997,48805,4375,40912,5727,2260,6474,34678,33709,44273,5792,40532,3999)"
}
},
{
"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 |
353 |
160M |
|
1471 |
156M |
|
2249 |
160M |
|
2260 |
160M |
|
3986 |
157M |
|
3988 |
160M |
|
3997 |
157M |
|
3999 |
155M |
|
4369 |
159M |
|
4375 |
159M |
|
4377 |
159M |
|
5727 |
155M |
|
5792 |
157M |
|
6474 |
155M |
|
6518 |
156,157M |
|
31879 |
155,156M |
|
33709 |
160M |
|
33721 |
160M |
|
34678 |
160M |
|
36295 |
210,209,160M |
|
36297 |
209,210,160M |
|
36468 |
157M |
|
36717 |
210,160M |
|
40532 |
160M |
|
40535 |
160M |
|
40912 |
155M |
|
41438 |
154M |
|
43650 |
409,160M |
|
43655 |
155M |
|
44273 |
156M |
|
46273 |
409,100M |
0 |
48805 |
210,155M |
|