Query time 0.00350
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": 40,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (5438,5818,40309,5770,1751,37294,6604,41358,40754,2086,31734,3854,36476,1436,5167,1266,798,37302,61,37284,45573,28115,41368,1542,41124,3464,4865,41387,62,27939,4938,1669)"
}
},
{
"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 |
61 |
119,118M |
|
62 |
119,118M |
|
798 |
143M |
|
1266 |
172M |
|
1436 |
317M |
|
1542 |
173M |
|
1669 |
174,172M |
|
1751 |
183M |
|
2086 |
155M |
|
3464 |
181M |
|
3854 |
181M |
|
4865 |
210,175M |
|
4938 |
316,317M |
|
5167 |
174M |
|
5438 |
171M |
|
5770 |
184M |
|
5818 |
341,340,174M |
|
6604 |
172M |
|
27939 |
166M |
|
28115 |
181M |
|
31734 |
165M |
|
36476 |
161M |
|
37284 |
145M |
|
37294 |
145M |
|
37302 |
145M |
|
40309 |
124M |
|
40754 |
409,183M |
|
41124 |
318M |
|
41358 |
145M |
|
41368 |
145M |
|
41387 |
145M |
|
45573 |
169M |
|