Query time 0.00312
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": 49,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (47274,4355,32188,43852,4861,37303,37288,4183,40507,4859,1774,1752,6176,28125,5762,987,3697,3846,37954,41355,4870,37287,36496,877,31920,3692,31644,27941,4302,1472,28450,41360)"
}
},
{
"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 |
877 |
340,171M |
|
987 |
143M |
|
1472 |
155,156M |
|
1752 |
183M |
|
1774 |
320,412,319M |
|
3692 |
341,340,174M |
|
3697 |
341,340,174M |
|
3846 |
181M |
|
4183 |
181M |
|
4302 |
316,317M |
|
4355 |
173M |
|
4859 |
175M |
|
4861 |
210,175M |
|
4870 |
210,175M |
|
5762 |
184M |
|
6176 |
181M |
|
27941 |
166M |
|
28125 |
181M |
|
28450 |
174M |
|
31644 |
117M |
|
31920 |
181M |
|
32188 |
172M |
|
36496 |
318M |
|
37287 |
145M |
|
37288 |
145M |
|
37303 |
145M |
|
37954 |
214M |
|
40507 |
122M |
|
41355 |
145M |
|
41360 |
145M |
|
43852 |
174,412,210M |
|
47274 |
210,209,409,99M |
|