Query time 0.00231
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": 41,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (40808,37295,5772,351,4887,2565,37298,1052,1850,37486,2155,6527,26858,26848,5759,47592,2626,406,6526,26862,3621,41130,31622,4889,37280,31902,21746,2250,35466,26863,43796,1051)"
}
},
{
"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 |
351 |
210,160M |
|
406 |
317M |
|
1051 |
156M |
|
1052 |
156,159M |
|
1850 |
146M |
|
2155 |
160M |
|
2250 |
197M |
|
2565 |
121M |
|
2626 |
146,318M |
|
3621 |
183M |
|
4887 |
181M |
|
4889 |
181M |
|
5759 |
184M |
|
5772 |
184M |
|
6526 |
210,193M |
|
6527 |
175,193M |
|
21746 |
156M |
|
26848 |
117M |
|
26858 |
117M |
|
26862 |
117M |
|
26863 |
117M |
|
31622 |
173M |
|
31902 |
122M |
|
35466 |
121M |
|
37280 |
145M |
|
37295 |
145M |
|
37298 |
145M |
|
37486 |
340M |
|
40808 |
124M |
|
41130 |
318M |
|
43796 |
122M |
|
47592 |
212,210,409,166M |
|