Query time 0.00186
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "50.80"
},
"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": 89,
"rows_produced_per_join": 89,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "9.19",
"eval_cost": "8.90",
"prefix_cost": "18.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 (87336,87337,87348,87349,89775,90902,90903,90981,90982,86603,86672,84642,82611,85374,85375,86482,86484,86758,86760,85280,85377,85428,85479,86461,86462,86737,86738,90745,90748,90751,90754,82638,83535,84646,85130,83582,83583,83584,83585,86479,86755,91118,91119,91204,91205,91259,91260,82615))"
}
},
{
"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": "22.25",
"eval_cost": "0.45",
"prefix_cost": "49.24",
"data_read_per_join": "11K"
},
"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.11",
"eval_cost": "0.45",
"prefix_cost": "50.80",
"data_read_per_join": "71"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 82611 |
7192M |
|
| 82615 |
7170,7171M |
0 |
| 82638 |
7192M |
|
| 83535 |
7192M |
|
| 83582 |
7170,7171M |
0 |
| 83583 |
7170,7171M |
0 |
| 83584 |
7170,7171M |
0 |
| 83585 |
7170,7171M |
0 |
| 84642 |
7170,7201M |
0 |
| 84646 |
7170,7191M |
0 |
| 85130 |
7192M |
|
| 85280 |
7170,7191M |
0 |
| 85374 |
7192M |
|
| 85375 |
7192M |
|
| 85377 |
7170,7191M |
0 |
| 85428 |
7170,7191M |
0 |
| 85479 |
7170,7191M |
0 |
| 86461 |
7170,7191,7310M |
0 |
| 86462 |
7170,7191,7310M |
0 |
| 86479 |
7170,7171M |
0 |
| 86482 |
7170,7171M |
0 |
| 86484 |
7170,7171M |
0 |
| 86603 |
7170,7191,7310M |
0 |
| 86672 |
7170,7191,7310M |
0 |
| 86737 |
7170,7191M |
0 |
| 86738 |
7170,7191M |
0 |
| 86755 |
7170,7171M |
0 |
| 86758 |
7170,7171M |
0 |
| 86760 |
7170,7171M |
0 |
| 87336 |
7170,7171M |
0 |
| 87337 |
7170,7171M |
0 |
| 87348 |
7170,7171M |
0 |
| 87349 |
7170,7171M |
0 |
| 89775 |
7192M |
|
| 90745 |
7170,7191M |
0 |
| 90748 |
7170,7191M |
0 |
| 90751 |
7170,7191M |
0 |
| 90754 |
7170,7191M |
0 |
| 90902 |
7192M |
|
| 90903 |
7192M |
|
| 90981 |
7192M |
|
| 90982 |
7192M |
|
| 91118 |
7171,7170M |
0 |
| 91119 |
7171,7170M |
0 |
| 91204 |
7171,7170M |
0 |
| 91205 |
7171,7170M |
0 |
| 91259 |
7171,7170M |
0 |
| 91260 |
7171,7170M |
0 |