Query time 0.00252
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "113.10"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 131,
"rows_produced_per_join": 131,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (5272,4991,5932,2354,4226,3346,4431,5276,4275,4195,3493,3342,1566,4460,5613,5925,5285,5346,5196,1631,3597,5670,3938,3345))",
"cost_info": {
"read_cost": "51.86",
"eval_cost": "13.10",
"prefix_cost": "64.96",
"data_read_per_join": "2K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"softwarepirmam_hewadelivard_cscart_4.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 6,
"filtered": "5.00",
"cost_info": {
"read_cost": "32.75",
"eval_cost": "0.66",
"prefix_cost": "110.81",
"data_read_per_join": "20K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`storefront_id` in (0,1)) and ((`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`))) and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`status` in ('A','H')))"
}
},
{
"table": {
"table_name": "product_position_source",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"ref": [
"const",
"softwarepirmam_hewadelivard_cscart_4.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 6,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.64",
"eval_cost": "0.66",
"prefix_cost": "113.10",
"data_read_per_join": "104"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1566 |
404,402,328,166,341M |
|
| 1631 |
380,250M |
0 |
| 2354 |
401,351,166,446M |
|
| 3342 |
545,543,568,546,521,250,166,406,402,328,343M |
0 |
| 3345 |
545,543,568,546,521,250,166,406,402,328,343M |
0 |
| 3346 |
568,545,543,546,521,250,166,406,402,328,343M |
0 |
| 3493 |
458,250,488M |
0 |
| 3597 |
250,166,351,401,446M |
0 |
| 3938 |
341,328,402,250,166,404M |
0 |
| 4195 |
386,308,250,350,166,382M |
0 |
| 4226 |
308,386,250,350,166,382M |
0 |
| 4275 |
386,308,250,350,166,382M |
0 |
| 4431 |
387,308,250,350,166,383M |
0 |
| 4460 |
387,308,250,350,166,383M |
0 |
| 4991 |
552,554,553,372,250,556M |
0 |
| 5196 |
166,250,402,328,409,366M |
0 |
| 5272 |
250,372,563,557,555,553,552,561M |
0 |
| 5276 |
250,372,563,557,555,553,552,561M |
0 |
| 5285 |
250,372,563,557,555,553,552,561M |
0 |
| 5346 |
554,553,250,372,552,556M |
0 |
| 5613 |
387,308,250,350,166,383M |
0 |
| 5670 |
570,406,402,250,543,328,166,567M |
0 |
| 5925 |
404,402,250,328,166,341M |
0 |
| 5932 |
423,308,387,250,350,166,383M |
0 |