Query time 0.00291
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "114.47"
},
"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": 129,
"rows_produced_per_join": 129,
"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,3040,3420,3461,3548,3547,5077,5983,129,5937,5970,1824,7034))",
"cost_info": {
"read_cost": "54.16",
"eval_cost": "12.90",
"prefix_cost": "67.06",
"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": 6,
"filtered": "5.00",
"cost_info": {
"read_cost": "32.25",
"eval_cost": "0.65",
"prefix_cost": "112.21",
"data_read_per_join": "25K"
},
"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": 6,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.61",
"eval_cost": "0.65",
"prefix_cost": "114.47",
"data_read_per_join": "103"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 129 |
187,8,23,7M |
0 |
| 186 |
23,8,7M |
0 |
| 1824 |
8,7M |
0 |
| 3039 |
23,187,7M |
0 |
| 3040 |
7,187,23M |
0 |
| 3420 |
23,187,7M |
0 |
| 3424 |
39,7M |
0 |
| 3461 |
39,7M |
0 |
| 3547 |
23,9,7M |
0 |
| 3548 |
23,9,7M |
0 |
| 3742 |
23,7M |
0 |
| 4038 |
39,23,187,7M |
0 |
| 5077 |
23,9M |
|
| 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 |
| 5937 |
7,16,1M |
0 |
| 5969 |
8,187,23,7M |
0 |
| 5970 |
7M |
0 |
| 5983 |
23,9M |
|
| 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 |
| 7034 |
48,8,349,41M |
|
| 7470 |
187,39,23,7M |
0 |