Query time 0.00066
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "32.67"
},
"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": 36,
"rows_produced_per_join": 36,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "3.87",
"eval_cost": "3.60",
"prefix_cost": "7.47",
"data_read_per_join": "576"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (96349,96537,96559,96560,96561,96842,96843,96844,96845,96846,96847,97057,97058,97059,97060,97061,97062,97063,97064,97065,97066,97067,97068,97069,97070,97071,97072,97073,97074,97075))"
}
},
{
"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": 36,
"filtered": "100.00",
"cost_info": {
"read_cost": "9.00",
"eval_cost": "3.60",
"prefix_cost": "20.07",
"data_read_per_join": "576"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
},
{
"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": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "9.00",
"eval_cost": "0.18",
"prefix_cost": "32.67",
"data_read_per_join": "4K"
},
"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')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 96349 |
7254M |
|
| 96537 |
7331,7253M |
|
| 96559 |
7331,7253M |
|
| 96560 |
7331,7253M |
|
| 96561 |
7331,7253M |
|
| 96842 |
7222M |
|
| 96843 |
7222M |
|
| 96844 |
7222M |
|
| 96845 |
7222M |
|
| 96846 |
7222M |
|
| 96847 |
7222M |
|
| 97057 |
7331,7253M |
|
| 97058 |
7331,7253M |
|
| 97059 |
7254M |
|
| 97060 |
7254M |
|
| 97061 |
7254M |
|
| 97062 |
7254M |
|
| 97063 |
7254M |
|
| 97064 |
7254M |
|
| 97065 |
7254M |
|
| 97066 |
7254M |
|
| 97067 |
7254M |
|
| 97068 |
7254M |
|
| 97069 |
7254M |
|
| 97070 |
7254M |
|
| 97071 |
7254M |
|
| 97072 |
7254M |
|
| 97073 |
7254M |
|
| 97074 |
7254M |
|
| 97075 |
7254M |
|