Query time 0.00179
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "141.71"
},
"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": 166,
"rows_produced_per_join": 166,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (7975,7974,7462,7463,6620,7584,7457,7439,7438,7437,6943,7568,7569,6067,6068,7972,7977,7976,7973,2886,2966,6386,6773,6810))",
"cost_info": {
"read_cost": "64.11",
"eval_cost": "16.60",
"prefix_cost": "80.71",
"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.50",
"eval_cost": "0.83",
"prefix_cost": "138.81",
"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.08",
"eval_cost": "0.83",
"prefix_cost": "141.72",
"data_read_per_join": "132"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 2886 |
167,9,226M |
|
| 2966 |
7,39,226M |
0 |
| 6067 |
349,231,8,7,276,226M |
0 |
| 6068 |
7,8,231,349,226M |
0 |
| 6386 |
231,7,10,226M |
0 |
| 6620 |
54,7,167,226M |
0 |
| 6773 |
231,7,167,226M |
0 |
| 6810 |
167,7,231,226M |
0 |
| 6943 |
182,349,8,231,7,226M |
0 |
| 7437 |
231,7,8,349,182,226M |
0 |
| 7438 |
231,7,8,349,182,226M |
0 |
| 7439 |
231,7,8,349,182,226M |
0 |
| 7457 |
231,7,8,349,182,226M |
0 |
| 7462 |
349,8,7,231,226M |
0 |
| 7463 |
349,8,7,231,226M |
0 |
| 7568 |
51,7,8,349,182,29M |
0 |
| 7569 |
51,7,8,349,182,29M |
0 |
| 7584 |
7,231,167,226M |
0 |
| 7972 |
7,8,231,349,226M |
0 |
| 7973 |
7,8,231,349,226M |
0 |
| 7974 |
7,349,182,226M |
0 |
| 7975 |
7,349,182,226M |
0 |
| 7976 |
7,8,231,349,226M |
0 |
| 7977 |
7,8,231,349,226M |
0 |