Query time 0.01068
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": 48,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (29729,4467,44765,46270,38118,47088,38124,37416,48122,43841,40914,40918,28140,47607,37330,46139,37398,40360,38116,5483,37329,4733,29819,46164,44481,3850,29730,44716,4454,37327,36575,47165)"
}
},
{
"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 |
3850 |
181M |
|
4454 |
181M |
|
4467 |
191M |
|
4733 |
195M |
|
5483 |
191M |
|
28140 |
181M |
|
29729 |
169M |
|
29730 |
169M |
|
29819 |
340M |
|
36575 |
195,166M |
|
37327 |
166M |
|
37329 |
166M |
|
37330 |
166M |
|
37398 |
166M |
|
37416 |
313,166M |
|
38116 |
166,340M |
|
38118 |
166,340M |
|
38124 |
340M |
|
40360 |
165M |
|
40914 |
313,340M |
|
40918 |
340M |
|
43841 |
182M |
|
44481 |
181M |
|
44716 |
163M |
|
44765 |
182M |
|
46139 |
166,194M |
|
46164 |
340,171M |
|
46270 |
166,195,105,101M |
|
47088 |
166,191M |
|
47165 |
118M |
|
47607 |
212,210,166M |
|
48122 |
166,213,169M |
|