Query time 0.00279
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "148.53"
},
"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": 167,
"rows_produced_per_join": 167,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (7676,7683,7298,7297,5968,2639,5113,7295,7772,7771,7294,7296,2640,7768,7759,7867,7758,7868,2641,7317,7320,7321,2642,5112,3141,7318,3142,2643,3143,7760,7761,7762,3144,5414,5411,5413,5412,5415,4321,4320,4323,4322,4324,4325,4337,4338,4340,4339))",
"cost_info": {
"read_cost": "70.46",
"eval_cost": "16.70",
"prefix_cost": "87.16",
"data_read_per_join": "2K"
},
"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": 8,
"filtered": "5.00",
"cost_info": {
"read_cost": "41.75",
"eval_cost": "0.84",
"prefix_cost": "145.61",
"data_read_per_join": "33K"
},
"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": 8,
"filtered": "100.00",
"cost_info": {
"read_cost": "2.09",
"eval_cost": "0.84",
"prefix_cost": "148.53",
"data_read_per_join": "133"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 2639 |
9,67,7M |
0 |
| 2640 |
67,9,7M |
0 |
| 2641 |
7,67,9M |
0 |
| 2642 |
7,67,9M |
0 |
| 2643 |
67,7,9M |
0 |
| 3141 |
7,67,9M |
0 |
| 3142 |
7,67,9M |
0 |
| 3143 |
7,67,9M |
0 |
| 3144 |
7,67,9M |
0 |
| 4320 |
67,444,7,9,400M |
0 |
| 4321 |
9,444,7,67,400M |
0 |
| 4322 |
67,444,7,9,400M |
0 |
| 4323 |
67,444,7,9,400M |
0 |
| 4324 |
67,444,7,9,400M |
0 |
| 4325 |
67,444,7,9,400M |
0 |
| 4337 |
67,444,7,9,400M |
0 |
| 4338 |
67,444,7,9,400M |
0 |
| 4339 |
67,444,7,9,400M |
0 |
| 4340 |
67,444,7,9,400M |
0 |
| 5112 |
9,67,7M |
0 |
| 5113 |
67,9,7M |
0 |
| 5411 |
9,67,7M |
0 |
| 5412 |
9,67,7M |
0 |
| 5413 |
9,67,7M |
0 |
| 5414 |
9,67,7M |
0 |
| 5415 |
9,67,7M |
0 |
| 5968 |
67,9,7M |
0 |
| 7294 |
67,9,7M |
0 |
| 7295 |
67,9,7M |
0 |
| 7296 |
67,9,7M |
0 |
| 7297 |
67,9,7M |
0 |
| 7298 |
67,9,7M |
0 |
| 7317 |
7,67,9M |
0 |
| 7318 |
7,67,9M |
0 |
| 7320 |
67,7,9M |
0 |
| 7321 |
67,7,9M |
0 |
| 7676 |
590,1,9,67,7M |
0 |
| 7683 |
67,9,590,1,7M |
0 |
| 7758 |
67,9,7M |
0 |
| 7759 |
67,9,7M |
0 |
| 7760 |
7,9,67M |
0 |
| 7761 |
9,67,7M |
0 |
| 7762 |
9M |
0 |
| 7768 |
67,9,7M |
0 |
| 7771 |
67,9,7M |
0 |
| 7772 |
67,9,7M |
0 |
| 7867 |
67,9,7M |
0 |
| 7868 |
67,9,7M |
0 |