Query time 0.00188
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 (84899,86486,86487,86762,86763,84314,88875,88876,88877,88878,88902,88903,82798,82871,82944,83253,83260,84798,84799,86601,86602,86670,86671,91068,85071,85157,85203,85249,82619,82620,83422,83423,89762,83029,83227,83232,83586,84668,84669,84878,90865,90944,85093,85179,85225,85271,82580,82581))"
}
},
{
"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 |
| 82580 |
7170,7191M |
0 |
| 82581 |
7170,7191M |
0 |
| 82619 |
7192M |
|
| 82620 |
7192M |
|
| 82798 |
7170,7191M |
0 |
| 82871 |
7170,7191M |
0 |
| 82944 |
7170,7191M |
0 |
| 83029 |
7170,7171M |
0 |
| 83227 |
7170,7171M |
0 |
| 83232 |
7170,7171M |
0 |
| 83253 |
7170,7191M |
0 |
| 83260 |
7170,7191M |
0 |
| 83422 |
7192M |
|
| 83423 |
7192M |
|
| 83586 |
7170,7171M |
0 |
| 84314 |
7223M |
|
| 84668 |
7223M |
|
| 84669 |
7223M |
|
| 84798 |
7170,7191M |
0 |
| 84799 |
7170,7191M |
0 |
| 84878 |
7170,7191M |
0 |
| 84899 |
7170,7191M |
0 |
| 85071 |
7170,7171M |
0 |
| 85093 |
7192M |
|
| 85157 |
7170,7171M |
0 |
| 85179 |
7192M |
|
| 85203 |
7170,7171M |
0 |
| 85225 |
7192M |
|
| 85249 |
7170,7171M |
0 |
| 85271 |
7192M |
|
| 86486 |
7192M |
|
| 86487 |
7192M |
|
| 86601 |
7170,7191,7310M |
0 |
| 86602 |
7170,7191,7310M |
0 |
| 86670 |
7170,7191,7310M |
0 |
| 86671 |
7170,7191,7310M |
0 |
| 86762 |
7192M |
|
| 86763 |
7192M |
|
| 88875 |
7170,7191M |
0 |
| 88876 |
7170,7191M |
0 |
| 88877 |
7170,7191M |
0 |
| 88878 |
7170,7191M |
0 |
| 88902 |
7170,7191M |
0 |
| 88903 |
7170,7191M |
0 |
| 89762 |
7192M |
|
| 90865 |
7171,7170M |
0 |
| 90944 |
7171,7170M |
0 |
| 91068 |
7191,7170M |
0 |