Query time 0.00171
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "47.96"
},
"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": 84,
"rows_produced_per_join": 84,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "8.69",
"eval_cost": "8.40",
"prefix_cost": "17.09",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (83988,83989,84111,90087,90097,88930,90107,91837,92011,92012,92013,92014,92015,92016,92017,92099,92100,92101,92102,92103,92104,92105,83089,84096,83104,84110,90080,83092,92500,84099,86219,89526,89723,90064,89641,91298,83106,91305,84112,89488,89637,92066,92082,83109,83119,85039,91306,91299))"
}
},
{
"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": 4,
"filtered": "5.00",
"cost_info": {
"read_cost": "21.00",
"eval_cost": "0.42",
"prefix_cost": "46.49",
"data_read_per_join": "10K"
},
"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": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.05",
"eval_cost": "0.42",
"prefix_cost": "47.96",
"data_read_per_join": "67"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 83089 |
7185M |
|
| 83092 |
7185M |
|
| 83104 |
7185M |
|
| 83106 |
7184,7187M |
0 |
| 83109 |
7186M |
|
| 83119 |
7186M |
|
| 83988 |
7186M |
|
| 83989 |
7186M |
|
| 84096 |
7185M |
|
| 84099 |
7185M |
|
| 84110 |
7185M |
|
| 84111 |
7184,7187M |
0 |
| 84112 |
7184,7187M |
0 |
| 85039 |
7341,7342,7343,7157M |
|
| 86219 |
7186M |
|
| 88930 |
7184,7187M |
0 |
| 89488 |
7184,7187M |
0 |
| 89526 |
7184,7187M |
0 |
| 89637 |
7184M |
0 |
| 89641 |
7184,7187M |
0 |
| 89723 |
7186M |
|
| 90064 |
7184,7187M |
0 |
| 90080 |
7184,7187M |
0 |
| 90087 |
7186M |
|
| 90097 |
7186M |
|
| 90107 |
7184,7187M |
0 |
| 91298 |
7187,7184M |
0 |
| 91299 |
7186M |
|
| 91305 |
7187,7184M |
0 |
| 91306 |
7187,7184M |
0 |
| 91837 |
7341,7342,7343,7157M |
|
| 92011 |
7186,7184M |
0 |
| 92012 |
7186,7184M |
0 |
| 92013 |
7186,7184M |
0 |
| 92014 |
7186,7184M |
0 |
| 92015 |
7186,7184M |
0 |
| 92016 |
7186,7184M |
0 |
| 92017 |
7186,7184M |
0 |
| 92066 |
7188M |
|
| 92082 |
7188M |
|
| 92099 |
7186,7184M |
0 |
| 92100 |
7186,7184M |
0 |
| 92101 |
7186,7184M |
0 |
| 92102 |
7186,7184M |
0 |
| 92103 |
7186,7184M |
0 |
| 92104 |
7186,7184M |
0 |
| 92105 |
7186,7184M |
0 |
| 92500 |
7341,7342,7343,7157M |
|