Query time 0.00119
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "25.81"
},
"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": 45,
"rows_produced_per_join": 45,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "4.78",
"eval_cost": "4.50",
"prefix_cost": "9.28",
"data_read_per_join": "720"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (82928,82929,83001,83002,83517,83518,83525,83526,83528,83022,83023,90858,90859,90937,90938,83050,83595,84675,84676,90886,90965,84629,84630,85366,85367,89765,84820,84821,91168,86146))"
}
},
{
"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.25",
"eval_cost": "0.23",
"prefix_cost": "25.03",
"data_read_per_join": "5K"
},
"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.56",
"eval_cost": "0.23",
"prefix_cost": "25.81",
"data_read_per_join": "36"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 82928 |
7192M |
|
| 82929 |
7192M |
|
| 83001 |
7192M |
|
| 83002 |
7192M |
|
| 83022 |
7170,7191M |
0 |
| 83023 |
7170,7191M |
0 |
| 83050 |
7170,7171M |
0 |
| 83517 |
7192M |
|
| 83518 |
7192M |
|
| 83525 |
7192M |
|
| 83526 |
7192M |
|
| 83528 |
7170,7171M |
0 |
| 83595 |
7170,7171M |
0 |
| 84629 |
7223M |
|
| 84630 |
7223M |
|
| 84675 |
7223M |
|
| 84676 |
7223M |
|
| 84820 |
7170,7171M |
0 |
| 84821 |
7170,7171M |
0 |
| 85366 |
7192M |
|
| 85367 |
7192M |
|
| 86146 |
7192M |
|
| 89765 |
7170,7191M |
0 |
| 90858 |
7191,7170M |
0 |
| 90859 |
7191,7170M |
0 |
| 90886 |
7171,7170M |
0 |
| 90937 |
7191,7170M |
0 |
| 90938 |
7191,7170M |
0 |
| 90965 |
7171,7170M |
0 |
| 91168 |
7171,7170M |
0 |