Query time 0.00200
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "66.50"
},
"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": 74,
"rows_produced_per_join": 74,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (7198,5065,3654,2237,3435,1486,1083,1231,1485,2238,3427,3437,3502,3501,3436,7751,6072,5603,6710,4839,4838,7593,7594,7595))",
"cost_info": {
"read_cost": "31.91",
"eval_cost": "7.40",
"prefix_cost": "39.31",
"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": 3,
"filtered": "5.00",
"cost_info": {
"read_cost": "18.50",
"eval_cost": "0.37",
"prefix_cost": "65.21",
"data_read_per_join": "14K"
},
"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": 3,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.93",
"eval_cost": "0.37",
"prefix_cost": "66.51",
"data_read_per_join": "59"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1083 |
9,24,7M |
0 |
| 1231 |
9,7M |
0 |
| 1485 |
9,24,7M |
0 |
| 1486 |
9,24,7M |
0 |
| 2237 |
9,24,7M |
0 |
| 2238 |
9,24,7M |
0 |
| 3427 |
9,24,7M |
0 |
| 3435 |
9,24,7M |
0 |
| 3436 |
9,24,7M |
0 |
| 3437 |
9,24,7M |
0 |
| 3501 |
9,24,7M |
0 |
| 3502 |
9,24,7M |
0 |
| 3654 |
9,24,7M |
0 |
| 4838 |
24,9,276,7M |
0 |
| 4839 |
9,276,24,7M |
0 |
| 5065 |
9,24,7M |
0 |
| 5603 |
49,450,9,276,1,24,7M |
0 |
| 6072 |
9,24,7M |
0 |
| 6710 |
584,9,24,1,7M |
0 |
| 7198 |
24,184,7M |
0 |
| 7593 |
7,24,9M |
0 |
| 7594 |
7,24,9M |
0 |
| 7595 |
7,24,9M |
0 |
| 7751 |
9,24,7M |
0 |