Query time 0.00200
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "54.77"
},
"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": 96,
"rows_produced_per_join": 96,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "9.89",
"eval_cost": "9.60",
"prefix_cost": "19.49",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (82853,82925,82926,82998,82999,83514,83515,83522,83523,85844,85845,85363,85364,86143,86166,86659,86728,89069,84337,85315,85412,85463,85514,82850,82923,82996,83512,83520,83596,83597,83598,83599,85361,86180,86182,86203,86205,86504,86506,86780,86782,89822,89823,89874,89875,89946,89947,91512))"
}
},
{
"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": "24.00",
"eval_cost": "0.48",
"prefix_cost": "53.09",
"data_read_per_join": "12K"
},
"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.20",
"eval_cost": "0.48",
"prefix_cost": "54.77",
"data_read_per_join": "76"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 82850 |
7170,7171M |
0 |
| 82853 |
7170,7171M |
0 |
| 82923 |
7170,7171M |
0 |
| 82925 |
7170,7171M |
0 |
| 82926 |
7170,7171M |
0 |
| 82996 |
7170,7171M |
0 |
| 82998 |
7170,7171M |
0 |
| 82999 |
7170,7171M |
0 |
| 83512 |
7170,7171M |
0 |
| 83514 |
7170,7171M |
0 |
| 83515 |
7170,7171M |
0 |
| 83520 |
7170,7171M |
0 |
| 83522 |
7170,7171M |
0 |
| 83523 |
7170,7171M |
0 |
| 83596 |
7170,7171M |
0 |
| 83597 |
7170,7171M |
0 |
| 83598 |
7170,7171M |
0 |
| 83599 |
7170,7171M |
0 |
| 84337 |
7170,7171M |
0 |
| 85315 |
7170,7171M |
0 |
| 85361 |
7170,7171M |
0 |
| 85363 |
7170,7171M |
0 |
| 85364 |
7170,7171M |
0 |
| 85412 |
7170,7171M |
0 |
| 85463 |
7170,7171M |
0 |
| 85514 |
7170,7171M |
0 |
| 85844 |
7170,7171M |
0 |
| 85845 |
7170,7171M |
0 |
| 86143 |
7170,7171M |
0 |
| 86166 |
7170,7171M |
0 |
| 86180 |
7170,7171M |
0 |
| 86182 |
7170,7171M |
0 |
| 86203 |
7170,7171M |
0 |
| 86205 |
7170,7171M |
0 |
| 86504 |
7170,7171M |
0 |
| 86506 |
7170,7171M |
0 |
| 86659 |
7170,7171M |
0 |
| 86728 |
7170,7171M |
0 |
| 86780 |
7170,7171M |
0 |
| 86782 |
7170,7171M |
0 |
| 89069 |
7170,7171M |
0 |
| 89822 |
7170,7171M |
0 |
| 89823 |
7170,7171M |
0 |
| 89874 |
7170,7171M |
0 |
| 89875 |
7170,7171M |
0 |
| 89946 |
7170,7171M |
0 |
| 89947 |
7170,7171M |
0 |
| 91512 |
7171,7170M |
0 |