Query time 0.00112
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "26.38"
},
"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": 46,
"rows_produced_per_join": 46,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "4.88",
"eval_cost": "4.60",
"prefix_cost": "9.48",
"data_read_per_join": "736"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (87390,84540,84606,84513,84579,84670,87405,84342,84341,86753,86754,87401,84495,84561,87399,84538,84604,84340,84315,86804,86805,84297,85662,85682,85694,85706,87431,85658,85667,85687))"
}
},
{
"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": 2,
"filtered": "5.00",
"cost_info": {
"read_cost": "11.50",
"eval_cost": "0.23",
"prefix_cost": "25.58",
"data_read_per_join": "6K"
},
"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": 2,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.58",
"eval_cost": "0.23",
"prefix_cost": "26.38",
"data_read_per_join": "36"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 84297 |
7223M |
0 |
| 84315 |
7223M |
0 |
| 84340 |
7223M |
0 |
| 84341 |
7223M |
0 |
| 84342 |
7223M |
0 |
| 84495 |
7223M |
0 |
| 84513 |
7223M |
0 |
| 84538 |
7223M |
0 |
| 84540 |
7223M |
0 |
| 84561 |
7223M |
0 |
| 84579 |
7223M |
0 |
| 84604 |
7223M |
0 |
| 84606 |
7223M |
0 |
| 84670 |
7223M |
0 |
| 85658 |
7170,7223M |
0 |
| 85662 |
7170,7223M |
0 |
| 85667 |
7170,7223M |
0 |
| 85682 |
7170,7223M |
0 |
| 85687 |
7170,7223M |
0 |
| 85694 |
7170,7223M |
0 |
| 85706 |
7170,7223M |
0 |
| 86753 |
7170,7223M |
0 |
| 86754 |
7170,7223M |
0 |
| 86804 |
7170,7223M |
0 |
| 86805 |
7170,7223M |
0 |
| 87390 |
7170,7223M |
0 |
| 87399 |
7170,7223M |
0 |
| 87401 |
7170,7223M |
0 |
| 87405 |
7170,7223M |
0 |
| 87431 |
7170,7223M |
0 |