Query time 0.00117
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "14.46"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"link_type",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 25,
"rows_produced_per_join": 25,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "2.77",
"eval_cost": "2.50",
"prefix_cost": "5.27",
"data_read_per_join": "400"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (83883,91764,91580,91581,91582,91583,91584,91585,91586,91587,91588,91589,83877,83880,83889,83890,83893,83895,83884,83886,91627,83891,83892,83896))"
}
},
{
"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": [
"nuie_scalesta_net.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "6.25",
"eval_cost": "0.13",
"prefix_cost": "14.02",
"data_read_per_join": "3K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`nuie_scalesta_net`.`cscart_categories`.`storefront_id` in (0,1)) and ((`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids`))) and (`nuie_scalesta_net`.`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",
"nuie_scalesta_net.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.31",
"eval_cost": "0.13",
"prefix_cost": "14.46",
"data_read_per_join": "20"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 83877 |
7254M |
0 |
| 83880 |
7254M |
0 |
| 83883 |
7254M |
0 |
| 83884 |
7254M |
0 |
| 83886 |
7254M |
0 |
| 83889 |
7254M |
0 |
| 83890 |
7254M |
0 |
| 83891 |
7254M |
0 |
| 83892 |
7254M |
0 |
| 83893 |
7254M |
0 |
| 83895 |
7254M |
0 |
| 83896 |
7254M |
0 |
| 91580 |
7254M |
0 |
| 91581 |
7254M |
0 |
| 91582 |
7254M |
0 |
| 91583 |
7254M |
0 |
| 91584 |
7254M |
0 |
| 91585 |
7254M |
0 |
| 91586 |
7254M |
0 |
| 91587 |
7254M |
0 |
| 91588 |
7254M |
0 |
| 91589 |
7254M |
0 |
| 91627 |
7290,7254M |
0 |
| 91764 |
7254M |
0 |