Query time 0.00182
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "146.90"
},
"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": 165,
"rows_produced_per_join": 165,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (5095,3147,5094,5097,7732,1522,1683,1685,2447,3554,3552,3553,7603,7604,7605,7606,4059,3865,4054,4058,4052,4056,4053,3870,3872,3871,3873,3862,5512,5513,5511,5514,5359,2958,7024,5863,5862,6860,6859,6856,6761,4591,5781,5714,7427,4969,2626,2627))",
"cost_info": {
"read_cost": "69.76",
"eval_cost": "16.50",
"prefix_cost": "86.26",
"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.25",
"eval_cost": "0.83",
"prefix_cost": "144.01",
"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.06",
"eval_cost": "0.83",
"prefix_cost": "146.90",
"data_read_per_join": "132"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1522 |
9,24,7M |
0 |
| 1683 |
24,9M |
0 |
| 1685 |
24,9M |
0 |
| 2447 |
24,9M |
0 |
| 2626 |
23,7,9M |
0 |
| 2627 |
7,23,9M |
0 |
| 2958 |
9M |
0 |
| 3147 |
9,24,7M |
0 |
| 3552 |
9,24,7M |
0 |
| 3553 |
9,24,7M |
0 |
| 3554 |
9,24,7M |
0 |
| 3862 |
39,9,24,7M |
0 |
| 3865 |
39,9,7,24M |
0 |
| 3870 |
7,9,39,24M |
0 |
| 3871 |
7,9,39,24M |
0 |
| 3872 |
7,9,39,24M |
0 |
| 3873 |
7,9,39,24M |
0 |
| 4052 |
7,39,9,24M |
0 |
| 4053 |
7,39,9,24M |
0 |
| 4054 |
7,39,9,24M |
0 |
| 4056 |
7,39,9,24M |
0 |
| 4058 |
7,39,9,24M |
0 |
| 4059 |
7,39,9,24M |
0 |
| 4591 |
9M |
0 |
| 4969 |
36,9,54,23,7M |
0 |
| 5094 |
9,24,7M |
0 |
| 5095 |
9,24,7M |
0 |
| 5097 |
9,24,7M |
0 |
| 5359 |
36,9,54,7M |
0 |
| 5511 |
1,9,49,23,7M |
0 |
| 5512 |
1,9,49,23,7M |
0 |
| 5513 |
1,9,49,23,7M |
0 |
| 5514 |
1,9,49,23,7M |
0 |
| 5714 |
1,9,49,23,7M |
0 |
| 5781 |
1,9,49,509,23,7M |
0 |
| 5862 |
23,9,7M |
0 |
| 5863 |
23,9,7M |
0 |
| 6761 |
23,54,9,36,7M |
0 |
| 6856 |
9,23,7M |
0 |
| 6859 |
23,9,7M |
0 |
| 6860 |
23,9,7M |
0 |
| 7024 |
7,9,23M |
0 |
| 7427 |
36,9,54,23,7M |
0 |
| 7603 |
24,9,7M |
0 |
| 7604 |
24,9,7M |
0 |
| 7605 |
24,9,7M |
0 |
| 7606 |
24,9,7M |
0 |
| 7732 |
9,24,7M |
0 |