Query time 0.00193
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": 44,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (2247,46696,3668,41384,48845,3190,732,31871,33132,4360,3195,1992,2152,38147,41013,45023,32305,5591,37288,37303,4294,1851,1752,2148,1999,6646,5485,987,2009,41355,37287,29705)"
}
},
{
"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 |
732 |
210,146M |
|
987 |
143M |
|
1752 |
183M |
|
1851 |
210,146M |
|
1992 |
210,176M |
|
1999 |
176M |
|
2009 |
176M |
|
2148 |
210,146M |
|
2152 |
160M |
|
2247 |
160M |
|
3190 |
169M |
|
3195 |
169M |
|
3668 |
412,210M |
|
4294 |
143M |
|
4360 |
191M |
|
5485 |
191M |
|
5591 |
191M |
|
6646 |
169M |
|
29705 |
199M |
|
31871 |
197M |
|
32305 |
166,313M |
|
33132 |
169M |
|
37287 |
145M |
|
37288 |
145M |
|
37303 |
145M |
|
38147 |
146M |
|
41013 |
144M |
|
41355 |
145M |
|
41384 |
143M |
|
45023 |
199M |
|
46696 |
210,213,409,166M |
|
48845 |
209,153M |
|