Query time 0.00387
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": 54,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (41590,41621,34674,48235,6198,15452,15322,6274,34668,30368,47828,277,48503,34667,2859,119,27356,31911,118,36272,1323,34669,6355,27262,47824,34666,31910,5992,1765,47600,34675,34670)"
}
},
{
"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 |
118 |
214M |
|
119 |
214M |
|
277 |
190M |
|
1323 |
166,212M |
|
1765 |
315,196M |
|
2859 |
193M |
|
5992 |
121M |
|
6198 |
340,341,412,210M |
|
6274 |
173M |
|
6355 |
412M |
|
15322 |
173M |
|
15452 |
174M |
|
27262 |
412,210M |
|
27356 |
409,210,165M |
|
30368 |
175M |
|
31910 |
122M |
|
31911 |
122M |
|
34666 |
122M |
|
34667 |
122M |
|
34668 |
122M |
|
34669 |
122M |
|
34670 |
122M |
|
34674 |
122M |
|
34675 |
122M |
|
36272 |
412,122M |
|
41590 |
114M |
|
41621 |
114M |
|
47600 |
212,210,409,166M |
|
47824 |
117,214M |
|
47828 |
172M |
|
48235 |
174,210,412,213M |
|
48503 |
317,210M |
|