Query time 0.00581
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": 63,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (44517,46559,4058,46561,47095,4060,46562,4057,46240,46557,48953,47269,4063,46560,4065,47096,48323,48816,4066,48818,49583,47272,4067,4062,49149,48821,48324,4064,48276,48819,48820,4068)"
}
},
{
"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 |
4057 |
194M |
|
4058 |
194M |
|
4060 |
194M |
|
4062 |
194M |
|
4063 |
194M |
|
4064 |
194M |
|
4065 |
194M |
|
4066 |
194M |
|
4067 |
194M |
|
4068 |
194M |
|
44517 |
175,193M |
|
46240 |
101,105,195,166M |
0 |
46557 |
195M |
|
46559 |
195M |
|
46560 |
195M |
|
46561 |
195M |
|
46562 |
195M |
|
47095 |
166,191M |
|
47096 |
166,191M |
|
47269 |
193,106M |
|
47272 |
193,151M |
|
48276 |
211,213,191M |
|
48323 |
212,315,191M |
|
48324 |
212,315,191M |
|
48816 |
166,195M |
|
48818 |
166,195,212M |
|
48819 |
166,212,195M |
|
48820 |
195,212,166M |
|
48821 |
195,212,166M |
|
48953 |
210,110,191,166M |
|
49149 |
213,193M |
|
49583 |
213,210,193M |
|