Query time 0.01511
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": 36,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (6068,5507,2563,3384,5505,31643,2415,144,2564,4459,31899,330,3382,5205,82,37847,33757,211,3374,3183,31900,25730,5815,41229,5500,2458,26854,6098,5226,405,2414,26864)"
}
},
{
"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 |
82 |
122M |
|
144 |
111M |
|
211 |
114M |
|
330 |
173M |
|
405 |
122M |
|
2414 |
121M |
|
2415 |
121M |
|
2458 |
169M |
|
2563 |
121M |
|
2564 |
121M |
|
3183 |
184M |
|
3374 |
121M |
|
3382 |
111M |
|
3384 |
122M |
|
4459 |
126M |
|
5205 |
184M |
|
5226 |
174M |
|
5500 |
121M |
|
5505 |
121M |
|
5507 |
121M |
|
5815 |
412,119M |
|
6068 |
175,193M |
|
6098 |
121M |
|
25730 |
122M |
|
26854 |
117M |
|
26864 |
117M |
|
31643 |
117M |
|
31899 |
122M |
|
31900 |
122M |
|
33757 |
412,174M |
|
37847 |
313M |
|
41229 |
214M |
|