Query time 0.00442
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": 45,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (47904,3196,5267,2805,6101,5765,33703,41444,5280,1517,37282,40755,40759,26865,35465,40421,35464,41430,31650,33701,31649,18749,23172,37885,18747,49346,2151,6105,287,5261,40811,2163)"
}
},
{
"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 |
287 |
193M |
|
1517 |
173M |
|
2151 |
160M |
|
2163 |
146,318M |
|
2805 |
210,173M |
|
3196 |
169M |
|
5261 |
122M |
|
5267 |
122M |
|
5280 |
122M |
|
5765 |
183,315M |
|
6101 |
121M |
|
6105 |
121M |
|
18747 |
163M |
|
18749 |
163M |
|
23172 |
199M |
|
26865 |
117M |
|
31649 |
340M |
|
31650 |
180M |
|
33701 |
210,145M |
|
33703 |
145M |
|
35464 |
121M |
|
35465 |
121M |
|
37282 |
145M |
|
37885 |
318M |
|
40421 |
122M |
|
40755 |
409,183M |
|
40759 |
118M |
|
40811 |
126M |
|
41430 |
210,318M |
|
41444 |
154M |
|
47904 |
110,315,213,214,412,119M |
|
49346 |
184M |
|