Query time 0.00123
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "31.49"
},
"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": 55,
"rows_produced_per_join": 55,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "5.78",
"eval_cost": "5.50",
"prefix_cost": "11.28",
"data_read_per_join": "880"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (91468,91469,83233,83234,83028,83581,90012,90740,90741,90864,90943,82843,82916,82989,83473,83481,85110,84510,84514,84576,84580,83293,83300,84884,84899,86486,86487,86762,86763,84314))"
}
},
{
"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": "13.75",
"eval_cost": "0.28",
"prefix_cost": "30.53",
"data_read_per_join": "7K"
},
"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.69",
"eval_cost": "0.28",
"prefix_cost": "31.49",
"data_read_per_join": "44"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 82843 |
7170,7171M |
0 |
| 82916 |
7170,7171M |
0 |
| 82989 |
7170,7171M |
0 |
| 83028 |
7170,7171M |
0 |
| 83233 |
7170,7171M |
0 |
| 83234 |
7170,7171M |
0 |
| 83293 |
7170,7192M |
0 |
| 83300 |
7170,7192M |
0 |
| 83473 |
7170,7171M |
0 |
| 83481 |
7170,7171M |
0 |
| 83581 |
7170,7171M |
0 |
| 84314 |
7223M |
|
| 84510 |
7170,7201M |
0 |
| 84514 |
7170,7191M |
0 |
| 84576 |
7170,7201M |
0 |
| 84580 |
7170,7191M |
0 |
| 84884 |
7170,7191M |
0 |
| 84899 |
7170,7191M |
0 |
| 85110 |
7170,7171M |
0 |
| 86486 |
7192M |
|
| 86487 |
7192M |
|
| 86762 |
7192M |
|
| 86763 |
7192M |
|
| 90012 |
7170,7191M |
0 |
| 90740 |
7170,7191M |
0 |
| 90741 |
7170,7191M |
0 |
| 90864 |
7171,7170M |
0 |
| 90943 |
7171,7170M |
0 |
| 91468 |
7191,7170M |
0 |
| 91469 |
7191,7170M |
0 |