Query time 0.00167
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "27.52"
},
"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": 48,
"rows_produced_per_join": 48,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "5.08",
"eval_cost": "4.80",
"prefix_cost": "9.88",
"data_read_per_join": "768"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (100552,100553,100554,100555,100556,100557,100558,100561,100564,100565,100566,100567,100568,100569,100570,100571,100572,100573,100574,100575,100576,100577,100578,100579,100580,100581,100586,100587,100588,100591,101576,101577,101578,101581,101582,101583,101584,101585,101586,101587,101588,101591,101594,101595,101596,101597,101598,101599))"
}
},
{
"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": "12.00",
"eval_cost": "0.24",
"prefix_cost": "26.68",
"data_read_per_join": "6K"
},
"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.60",
"eval_cost": "0.24",
"prefix_cost": "27.52",
"data_read_per_join": "38"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 100552 |
7270M |
0 |
| 100553 |
7270M |
0 |
| 100554 |
7270M |
0 |
| 100555 |
7270M |
0 |
| 100556 |
7270M |
0 |
| 100557 |
7270M |
0 |
| 100558 |
7270M |
0 |
| 100561 |
7270M |
0 |
| 100564 |
7270M |
0 |
| 100565 |
7270M |
0 |
| 100566 |
7270M |
0 |
| 100567 |
7270M |
0 |
| 100568 |
7270M |
0 |
| 100569 |
7270M |
0 |
| 100570 |
7270M |
0 |
| 100571 |
7270M |
0 |
| 100572 |
7270M |
0 |
| 100573 |
7270M |
0 |
| 100574 |
7270M |
0 |
| 100575 |
7270M |
0 |
| 100576 |
7270M |
0 |
| 100577 |
7270M |
0 |
| 100578 |
7270M |
0 |
| 100579 |
7270M |
0 |
| 100580 |
7270M |
0 |
| 100581 |
7270M |
0 |
| 100586 |
7270M |
0 |
| 100587 |
7270M |
0 |
| 100588 |
7270M |
0 |
| 100591 |
7270M |
0 |
| 101576 |
7270M |
0 |
| 101577 |
7270M |
0 |
| 101578 |
7270M |
0 |
| 101581 |
7270M |
0 |
| 101582 |
7270M |
0 |
| 101583 |
7270M |
0 |
| 101584 |
7270M |
0 |
| 101585 |
7270M |
0 |
| 101586 |
7270M |
0 |
| 101587 |
7270M |
0 |
| 101588 |
7270M |
0 |
| 101591 |
7270M |
0 |
| 101594 |
7270M |
0 |
| 101595 |
7270M |
0 |
| 101596 |
7270M |
0 |
| 101597 |
7270M |
0 |
| 101598 |
7270M |
0 |
| 101599 |
7270M |
0 |