Query time 0.00171
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 (87325,87336,87337,87348,87349,86482,86484,86758,86760,83582,83583,83584,83585,86479,86755,91118,91119,91204,91205,91259,91260,82615,82617,82625,82626,83418,83420,83490,83491,86651,86720,87300,87301,82612,83411,91149,91150,86480,86756,85073,85159,85205,85251,82613,83416,83031,83033,83588))"
}
},
{
"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 |
| 82612 |
7170,7171M |
0 |
| 82613 |
7170,7171M |
0 |
| 82615 |
7170,7171M |
0 |
| 82617 |
7170,7171M |
0 |
| 82625 |
7170,7171M |
0 |
| 82626 |
7170,7171M |
0 |
| 83031 |
7170,7171M |
0 |
| 83033 |
7170,7171M |
0 |
| 83411 |
7170,7171M |
0 |
| 83416 |
7170,7171M |
0 |
| 83418 |
7170,7171M |
0 |
| 83420 |
7170,7171M |
0 |
| 83490 |
7170,7171M |
0 |
| 83491 |
7170,7171M |
0 |
| 83582 |
7170,7171M |
0 |
| 83583 |
7170,7171M |
0 |
| 83584 |
7170,7171M |
0 |
| 83585 |
7170,7171M |
0 |
| 83588 |
7170,7171M |
0 |
| 85073 |
7170,7171M |
0 |
| 85159 |
7170,7171M |
0 |
| 85205 |
7170,7171M |
0 |
| 85251 |
7170,7171M |
0 |
| 86479 |
7170,7171M |
0 |
| 86480 |
7170,7171M |
0 |
| 86482 |
7170,7171M |
0 |
| 86484 |
7170,7171M |
0 |
| 86651 |
7170,7171M |
0 |
| 86720 |
7170,7171M |
0 |
| 86755 |
7170,7171M |
0 |
| 86756 |
7170,7171M |
0 |
| 86758 |
7170,7171M |
0 |
| 86760 |
7170,7171M |
0 |
| 87300 |
7170,7171M |
0 |
| 87301 |
7170,7171M |
0 |
| 87325 |
7170,7171M |
0 |
| 87336 |
7170,7171M |
0 |
| 87337 |
7170,7171M |
0 |
| 87348 |
7170,7171M |
0 |
| 87349 |
7170,7171M |
0 |
| 91118 |
7171,7170M |
0 |
| 91119 |
7171,7170M |
0 |
| 91149 |
7171,7170M |
0 |
| 91150 |
7171,7170M |
0 |
| 91204 |
7171,7170M |
0 |
| 91205 |
7171,7170M |
0 |
| 91259 |
7171,7170M |
0 |
| 91260 |
7171,7170M |
0 |