Query time 0.00133
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 (89649,83970,83971,83972,83973,89620,89633,91304,83982,83983,83984,83985,91300,89650,89187,90067,90081,91839,89485,90083,86220,83128,84030,84031,84032,84033,84038,90082,88935,89188))"
}
},
{
"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 |
| 83128 |
7186M |
|
| 83970 |
7184,7187M |
0 |
| 83971 |
7184,7187M |
0 |
| 83972 |
7184,7187M |
0 |
| 83973 |
7184,7187M |
0 |
| 83982 |
7186M |
|
| 83983 |
7186M |
|
| 83984 |
7186M |
|
| 83985 |
7186M |
|
| 84030 |
7184,7187M |
0 |
| 84031 |
7184,7187M |
0 |
| 84032 |
7184,7187M |
0 |
| 84033 |
7184,7187M |
0 |
| 84038 |
7184,7187M |
0 |
| 86220 |
7185M |
|
| 88935 |
7184,7187M |
0 |
| 89187 |
7186M |
|
| 89188 |
7185M |
|
| 89485 |
7186M |
|
| 89620 |
7185M |
|
| 89633 |
7185M |
|
| 89649 |
7186M |
|
| 89650 |
7184,7187M |
0 |
| 90067 |
7185M |
|
| 90081 |
7186M |
|
| 90082 |
7185M |
|
| 90083 |
7184,7187M |
0 |
| 91300 |
7185M |
|
| 91304 |
7186M |
|
| 91839 |
7341,7342,7343,7157M |
|