Query time 0.00115
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "37.17"
},
"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": 65,
"rows_produced_per_join": 65,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "6.78",
"eval_cost": "6.50",
"prefix_cost": "13.28",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (92024,92025,92107,92108,92109,92110,92111,92112,92113,89626,89639,83097,92151,92152,92153,92353,92354,92355,92356,89651,89652,84103,83974,83975,83976,83977,84014,84015,84016,84017))"
}
},
{
"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": 3,
"filtered": "5.00",
"cost_info": {
"read_cost": "16.25",
"eval_cost": "0.33",
"prefix_cost": "36.03",
"data_read_per_join": "8K"
},
"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": 3,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.81",
"eval_cost": "0.33",
"prefix_cost": "37.17",
"data_read_per_join": "52"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 83097 |
7185M |
|
| 83974 |
7188M |
|
| 83975 |
7188M |
|
| 83976 |
7188M |
|
| 83977 |
7188M |
|
| 84014 |
7184,7187M |
0 |
| 84015 |
7184,7187M |
0 |
| 84016 |
7184,7187M |
0 |
| 84017 |
7184,7187M |
0 |
| 84103 |
7185M |
|
| 89626 |
7186M |
|
| 89639 |
7186M |
|
| 89651 |
7184,7187M |
0 |
| 89652 |
7186M |
|
| 92024 |
7187,7184M |
0 |
| 92025 |
7187,7184M |
0 |
| 92107 |
7187,7184M |
0 |
| 92108 |
7187,7184M |
0 |
| 92109 |
7187,7184M |
0 |
| 92110 |
7187,7184M |
0 |
| 92111 |
7187,7184M |
0 |
| 92112 |
7187,7184M |
0 |
| 92113 |
7187,7184M |
0 |
| 92151 |
7341,7342,7343,7157M |
|
| 92152 |
7341,7342,7343,7157M |
|
| 92153 |
7341,7342,7343,7157M |
|
| 92353 |
7341,7342,7343,7157M |
|
| 92354 |
7341,7342,7343,7157M |
|
| 92355 |
7341,7342,7343,7157M |
|
| 92356 |
7341,7342,7343,7157M |
|