Query time 0.00665
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": 107,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (49159,49151,49579,49581,48243,48264,48273,48265,48632,48971,49152,48267,48658,48633,48661,48329,48626,48274,49150,49148,49160,48660,48950,49580,49582,49153,48663,48327,48268,49158,49014,49155)"
}
},
{
"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 |
48243 |
213,210,110,155M |
0 |
48264 |
211,213,191M |
0 |
48265 |
211,191,213M |
0 |
48267 |
213,211,191M |
0 |
48268 |
213,211,191M |
0 |
48273 |
213,211,191M |
0 |
48274 |
213,211,191M |
0 |
48327 |
210,213,169M |
0 |
48329 |
210,213,169M |
0 |
48626 |
201,213,211M |
0 |
48632 |
201,213,211M |
0 |
48633 |
211,213,201M |
0 |
48658 |
199,213,212M |
0 |
48660 |
212,213,149M |
0 |
48661 |
212,213,149M |
0 |
48663 |
212,213,149M |
0 |
48950 |
213,110,199M |
0 |
48971 |
213,212,110,199M |
0 |
49014 |
213,201M |
0 |
49148 |
193,213M |
0 |
49150 |
213,193M |
0 |
49151 |
213,193M |
0 |
49152 |
213,210,144M |
0 |
49153 |
213,210,99,151M |
0 |
49155 |
210,213,99,150M |
0 |
49158 |
99,213,210,151M |
0 |
49159 |
99,210,213,151M |
0 |
49160 |
213,99,151,210,150M |
0 |
49579 |
210,213,156M |
0 |
49580 |
213,210,156M |
0 |
49581 |
210,213,156M |
0 |
49582 |
213,210,156M |
0 |