Query time 0.00719
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": 51,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (22172,2157,38152,47085,38146,38145,3601,286,26467,47148,4389,2163,15613,4393,1850,2626,4392,38150,4394,38141,20830,38148,18274,2159,2162,732,38147,1851,2148,1840,1852,2625)"
}
},
{
"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 |
286 |
146M |
0 |
732 |
210,146M |
0 |
1840 |
146,318M |
0 |
1850 |
146M |
0 |
1851 |
210,146M |
0 |
1852 |
210,146M |
0 |
2148 |
210,146M |
0 |
2157 |
210,146,318M |
0 |
2159 |
146M |
0 |
2162 |
146,318M |
0 |
2163 |
146,318M |
0 |
2625 |
146,210,318M |
0 |
2626 |
146,318M |
0 |
3601 |
146M |
0 |
4389 |
146M |
0 |
4392 |
146M |
0 |
4393 |
146M |
0 |
4394 |
146M |
0 |
15613 |
146,318M |
0 |
18274 |
146M |
0 |
20830 |
146,210,318M |
0 |
22172 |
146M |
0 |
26467 |
146M |
0 |
38141 |
146M |
0 |
38145 |
146M |
0 |
38146 |
210,146M |
0 |
38147 |
146M |
0 |
38148 |
146M |
0 |
38150 |
146M |
0 |
38152 |
146M |
0 |
47085 |
210,146M |
0 |
47148 |
146M |
0 |