Query time 0.01684
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": 57,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (40438,47567,37316,26887,45360,4442,23044,502,46548,27002,41123,23017,26871,1895,26889,26898,44858,1715,26897,23047,26876,47657,40441,5994,47654,4512,26870,42111,26893,26878,26874,26888)"
}
},
{
"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 |
502 |
169M |
|
1715 |
123M |
|
1895 |
315,212,409,196M |
|
4442 |
153,195M |
|
4512 |
199M |
|
5994 |
121M |
|
23017 |
175M |
|
23044 |
210,169M |
|
23047 |
210,212,169M |
|
26870 |
169M |
|
26871 |
169M |
|
26874 |
169M |
|
26876 |
169M |
|
26878 |
169M |
|
26887 |
169M |
|
26888 |
169M |
|
26889 |
169M |
|
26893 |
169M |
|
26897 |
169M |
|
26898 |
169M |
|
27002 |
169M |
|
37316 |
210,145M |
|
40438 |
409,149M |
|
40441 |
409,149M |
|
41123 |
318M |
|
42111 |
114M |
|
44858 |
412,174M |
|
45360 |
169M |
|
46548 |
169M |
|
47567 |
122,412M |
|
47654 |
110,119,412,213M |
|
47657 |
110,315,119,412,213M |
|