Query time 0.00126
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "84.49"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 96,
"rows_produced_per_join": 96,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (5783,5602,5228,5969,5524,3424,5558,5559,5555,5557,186,7032,7031,7028,7029,7030,7033,6757,6759,6758,3742,7470,4038,3039))",
"cost_info": {
"read_cost": "39.61",
"eval_cost": "9.60",
"prefix_cost": "49.21",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"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": [
"dbggbern.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": "82.81",
"data_read_per_join": "19K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`dbggbern`.`cscart_categories`.`storefront_id` in (0,1)) and ((`dbggbern`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`dbggbern`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`dbggbern`.`cscart_categories`.`usergroup_ids`))) and (`dbggbern`.`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",
"dbggbern.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": "84.49",
"data_read_per_join": "76"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 186 |
23,8,7M |
0 |
| 3039 |
23,187,7M |
0 |
| 3424 |
39,7M |
0 |
| 3742 |
23,7M |
0 |
| 4038 |
39,23,187,7M |
0 |
| 5228 |
8,187,23,7M |
0 |
| 5524 |
7,49,39,84,23,1M |
0 |
| 5555 |
1,167,49,23,7M |
0 |
| 5557 |
1,167,49,23,7M |
0 |
| 5558 |
1,167,49,23,7M |
0 |
| 5559 |
1,167,49,23,7M |
0 |
| 5602 |
1,167,49,23,7M |
0 |
| 5783 |
1,167,49,23,7M |
0 |
| 5969 |
8,187,23,7M |
0 |
| 6757 |
23,8,349,182,7M |
0 |
| 6758 |
23,167,7M |
0 |
| 6759 |
23,9,7M |
0 |
| 7028 |
7,182,8,349,23M |
0 |
| 7029 |
7,9,23M |
0 |
| 7030 |
7,167,23M |
0 |
| 7031 |
7,9,23M |
0 |
| 7032 |
23,16,7M |
0 |
| 7033 |
7,8,182,349,23M |
0 |
| 7470 |
187,39,23,7M |
0 |