Query time 0.00224
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": 40,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (1040,2086,36476,3981,5800,4433,36469,3982,4383,979,978,5635,5381,36466,2259,15235,4003,6519,5799,2248,5420,41445,40725,3996,3237,36303,38151,2256,35193,982,4384,36302)"
}
},
{
"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 |
978 |
155M |
|
979 |
155M |
|
982 |
155M |
|
1040 |
155,156M |
|
2086 |
155M |
|
2248 |
160M |
|
2256 |
154M |
|
2259 |
154M |
|
3237 |
157M |
|
3981 |
160M |
|
3982 |
160M |
|
3996 |
157M |
|
4003 |
157M |
|
4383 |
160M |
|
4384 |
160M |
|
4433 |
155M |
|
5381 |
156M |
|
5420 |
157M |
|
5635 |
209,154M |
|
5799 |
157M |
|
5800 |
157M |
|
6519 |
156,157M |
|
15235 |
155M |
|
35193 |
154M |
|
36302 |
209,210,160M |
|
36303 |
210,409,160M |
|
36466 |
156M |
|
36469 |
154M |
|
36476 |
161M |
|
38151 |
160M |
|
40725 |
409,155M |
|
41445 |
154M |
|