Query time 0.00125
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "28.08"
},
"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": 49,
"rows_produced_per_join": 49,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "5.18",
"eval_cost": "4.90",
"prefix_cost": "10.08",
"data_read_per_join": "784"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (83533,83534,89769,85129,86132,86155,86640,86709,82854,82927,83000,83516,83524,86175,86176,86198,86199,84497,84498,84563,84564,82803,82804,82876,82877,82949,82950,83021,85101,89049))"
}
},
{
"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.25",
"eval_cost": "0.25",
"prefix_cost": "27.23",
"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.61",
"eval_cost": "0.25",
"prefix_cost": "28.09",
"data_read_per_join": "39"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 82803 |
7170,7191M |
0 |
| 82804 |
7170,7191M |
0 |
| 82854 |
7192M |
|
| 82876 |
7170,7191M |
0 |
| 82877 |
7170,7191M |
0 |
| 82927 |
7192M |
|
| 82949 |
7170,7191M |
0 |
| 82950 |
7170,7191M |
0 |
| 83000 |
7192M |
|
| 83021 |
7170,7191M |
0 |
| 83516 |
7192M |
|
| 83524 |
7192M |
|
| 83533 |
7192M |
|
| 83534 |
7192M |
|
| 84497 |
7223M |
|
| 84498 |
7223M |
|
| 84563 |
7223M |
|
| 84564 |
7223M |
|
| 85101 |
7170,7171M |
0 |
| 85129 |
7170,7171M |
0 |
| 86132 |
7170,7171M |
0 |
| 86155 |
7170,7171M |
0 |
| 86175 |
7170,7171M |
0 |
| 86176 |
7170,7171M |
0 |
| 86198 |
7170,7171M |
0 |
| 86199 |
7170,7171M |
0 |
| 86640 |
7170,7171M |
0 |
| 86709 |
7170,7171M |
0 |
| 89049 |
7170,7223M |
0 |
| 89769 |
7170,7171M |
0 |