Query time 0.00186
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "58.96"
},
"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": 66,
"rows_produced_per_join": 66,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (3046,5706,5720,4933,5850,5821,2922,5849,3935,5828,5703,4115,5832,1284,1528,1563,1588,5824,1570,3826))",
"cost_info": {
"read_cost": "28.11",
"eval_cost": "6.60",
"prefix_cost": "34.71",
"data_read_per_join": "1K"
},
"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": 3,
"filtered": "5.00",
"cost_info": {
"read_cost": "16.50",
"eval_cost": "0.33",
"prefix_cost": "57.81",
"data_read_per_join": "10K"
},
"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": 3,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.83",
"eval_cost": "0.33",
"prefix_cost": "58.97",
"data_read_per_join": "52"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1284 |
322,166,324M |
0 |
| 1528 |
453,454,372,174,166,190M |
0 |
| 1563 |
411,405,402,342,328,166,363M |
0 |
| 1570 |
402,411,405,342,328,166,363M |
0 |
| 1588 |
410,405,402,342,328,166,362M |
0 |
| 2922 |
423,424,450,166M |
0 |
| 3046 |
234,166,470M |
0 |
| 3826 |
250,166,401,351,446M |
0 |
| 3935 |
341,328,402,250,166,404M |
0 |
| 4115 |
513,166,514M |
0 |
| 4933 |
423,520,166M |
0 |
| 5703 |
423,449,166M |
0 |
| 5706 |
423,449,166M |
0 |
| 5720 |
423,449,166M |
0 |
| 5821 |
423,477,166M |
0 |
| 5824 |
423,477,166M |
0 |
| 5828 |
423,477,166M |
0 |
| 5832 |
423,477,166M |
0 |
| 5849 |
426,424,423,166M |
0 |
| 5850 |
423,477,166M |
0 |