Query time 0.00196
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "93.48"
},
"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": 107,
"rows_produced_per_join": 107,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (7072,7071,7070,2773,6437,6435,6434,6440,6438,6439,7617,7223,7616,7613,7615,7614,7618,7115,7116,7221,3044,7222,1243,7224))",
"cost_info": {
"read_cost": "43.46",
"eval_cost": "10.70",
"prefix_cost": "54.16",
"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": 5,
"filtered": "5.00",
"cost_info": {
"read_cost": "26.75",
"eval_cost": "0.54",
"prefix_cost": "91.61",
"data_read_per_join": "21K"
},
"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": 5,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.34",
"eval_cost": "0.54",
"prefix_cost": "93.48",
"data_read_per_join": "85"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1243 |
167,36,7M |
0 |
| 2773 |
9,36,7M |
0 |
| 3044 |
167,36,7M |
0 |
| 6434 |
182,349,8,7,23,36M |
0 |
| 6435 |
7,16,23,36M |
0 |
| 6437 |
23,7,16,36M |
0 |
| 6438 |
23,7,167,36M |
0 |
| 6439 |
23,7,16,36M |
0 |
| 6440 |
23,7,9,36M |
0 |
| 7070 |
8,182,36M |
|
| 7071 |
8,182,36M |
|
| 7072 |
8,182,36M |
|
| 7115 |
182,349,8,7,23,36M |
0 |
| 7116 |
23,7,9,36M |
0 |
| 7221 |
7,23,9,36M |
0 |
| 7222 |
7,23,9,36M |
0 |
| 7223 |
7,23,9,36M |
0 |
| 7224 |
7,23,9,36M |
0 |
| 7613 |
7,54,8,182,349,36M |
0 |
| 7614 |
36,54,16,7M |
0 |
| 7615 |
54,7,170,36M |
0 |
| 7616 |
36,54,16,7M |
0 |
| 7617 |
36,54,16,7M |
0 |
| 7618 |
36,54,16,7M |
0 |